Plupload Filename Problem
Solution 1:
There is a configuration option to generate unique file names instead of using the actual file name.
From the docs:
unique_names Generate unique filenames when uploading. This will generate unqiue filenames for the files so that they don't for example collide with existing ones on the server.
Make sure this option is not enabled in your configuration (it is not by default). There are still some file name cleaning routines run by the default included php upload script...
// Clean the fileName for security reasons$fileName = preg_replace('/[^\w\._]+/', '', $fileName);
...and an underscore is always appended with a number if the file exists (regardless of configuration), like filename_2.jpg
, but aside from that it should not be altering your file names.
EDIT: I've been searching the forums for a solution but coming up short, my last piece of advice is to try the HTML5 runtime, to see if this is related to the Flash runtime somehow, as there have been some issues with previous versions. If all else fails, post on the forum - the admins there are very responsive. Best of luck, please post a solution here if you find it.
Solution 2:
Ploploader uses a variable called "unique_names"; in my case this was set to TRUE, however to preserve the actual filenames it should be set to false. Solution came from the Pluploader forum.
Solution 3:
To keep original filename, if you use the upload.php provided by plupload then I had to change upload.php line 34 from
$fileName = isset($_REQUEST['name']) ? $_REQUEST['name'] : '';
to
$fileName = isset($_FILES['file']["name"]) ? $_FILES['file']["name"] : '';
Solution 4:
I had the same problem. An another solution is to inject real file name as a new input into FormData object.
(I am using chrome and HTML5 runtime!)
in plupload.html5.js
file find the creation of object O = new FormData();
and
add some injections with
var oFileName = $("input[name='oFileName']").val();
O.append("oFileName", V.name);
After this adding get the real file name in your server side (for upload.php)
$oFileName = $_REQUEST["oFileName"];
Post a Comment for "Plupload Filename Problem"