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
Hi, try this:
oneforall/ajax/upload.php line 222
Comment out this line
$filename = str_replace(' ', '_', $filename); // Replace spaces by underscores
add this line below
$filename = media_filename($filename);
@ will be removed. if you want to convert it to something, change the line to
$filename = media_filename(str_replace('@', '-at-', $filename));
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.
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
$filename = str_replace(' ', '_', $filename); // Replace spaces by underscores
add this line below
$filename = media_filename($filename);
@ will be removed. if you want to convert it to something, change the line to
$filename = media_filename(str_replace('@', '-at-', $filename));
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.
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 :)
Yes, sorry, i mean comment the line 222. this line should do nothing.
// $filename = str_replace(' ', '_', $filename); // Replace spaces by underscores
Because the next new line do the work. :-)