WebsiteBaker Support (2.12.x) > Modules

Plupload problem with filenames and large files in OneForAll

(1/1)

CodeALot:
OneForAll uses PLUPLOAD to handle the upload of images.

What needs to be changed to have PLUPLOAD handle/alter the filename upon saving? It refuses filenames with special characters (copyright-sign, for instance) and does not replace spaces (should be, to avoid validation errors).

Also, I've noticed that PLUPLOAD does not accept large files. If I try to upload an image of say 9 MB, it will come back with the error "Filename already exists". 
Then, when I save the OFA-item and go back into it, I see that the large image was in fact partially saved.
Something goes wrong with the storing of the file, it seems.

WB-version 2.12.2
OFA version 2.0.2.23
PHP 7.3

dbs:
Hi, try this:
oneforall/ajax/upload.php line 222
Comment out this line

--- Code: ---$filename   = str_replace(' ', '_', $filename);          // Replace spaces by underscores
--- End code ---
add this line below

--- Code: ---$filename = media_filename($filename);
--- End code ---

@ will be removed. if you want to convert it to something, change the line to

--- Code: ---$filename = media_filename(str_replace('@', '-at-', $filename));
--- End code ---

Info: the function media_filename() comes from framework/functions.php

Large files can't be uploaded if your hoster do not allow this file size or the needed time for this.
Keywords are max_file_size, max_execution_time and more.
It is planned to convert the files before uploading.

CodeALot:
Hi , thanks for your reply.

But... you mean UNcomment, right? If I comment out those lines, they won't do anything...


--- Quote from: dbs on July 25, 2019, 01:15:23 PM ---Hi, try this:
oneforall/ajax/upload.php line 222
Comment out this line

--- Code: ---$filename   = str_replace(' ', '_', $filename);          // Replace spaces by underscores
--- End code ---
add this line below

--- Code: ---$filename = media_filename($filename);
--- End code ---

@ will be removed. if you want to convert it to something, change the line to

--- Code: ---$filename = media_filename(str_replace('@', '-at-', $filename));
--- End code ---

Info: the function media_filename() comes from framework/functions.php

Large files can't be uploaded if your hoster do not allow this file size or the needed time for this.
Keywords are max_file_size, max_execution_time and more.
It is planned to convert the files before uploading.

--- End quote ---

Yeah, I resize the images now before uploading but it would be nice to be able to upload big files straight from cameras, for instance :)

dbs:
Yes, sorry, i mean comment the line 222. this line should do nothing.

--- Code: ---// $filename   = str_replace(' ', '_', $filename);          // Replace spaces by underscores
--- End code ---
Because the next new line do the work. :-)

Navigation

[0] Message Index

Go to full version