JQuery PLUpload How to get renamed filename?

I have already implemented the PLUpload Html5 plugin for my kodovoz. I can get the upload to work, but was unable to get the updated name of the renamed file.

I did print_r ($ this-> input-> post ()) and it returns one of the fields as [update_0_name] test-file-name.png. The actual filename that was renamed was test_file_name.png or even test_filne_name_1.png if there is a duplicate file.

So how can I get the updated filename?

I was curious as to why dump.php might get the updated filename while I can't. Please help me, thanks!


source to share

1 answer

Somehow I managed to find an answer in StackOverFlow.

uploader.bind('FileUploaded', function(up, file, info) {
    var obj = JSON.parse(info.response);
    $('form#form-files-uploader').append('<input type="hidden" name="file_name" value="' + obj.cleanFileName + '" />');


This works for me. Please advise if this is correct even if it works. Thank.



All Articles