weixiyen / jquery-filedrop

jQuery plugin - drag and drop desktop files and POST to a URL to handle files.
958 stars 285 forks source link

UTF-8 characters in POST data #112

Closed nstCactus closed 11 years ago

nstCactus commented 11 years ago

When submitting formData containing non-ASCII characters, I encountered strange problem on the server-side. In my case, using php and Zend Framework 1.12, the string was truncated after the first non-ASCII character which was replaced by a question mark.

Ex: After submitting "valeur à tester", I get on the server-side "valeur ?".

akaJes commented 11 years ago

Just modify code at line https://github.com/weixiyen/jquery-filedrop/blob/master/jquery.filedrop.js#L124 as builder += '; filename="' + encodeURI(filename) + '"'; and use urldecode() as in example move_uploaded_file($pic['tmp_name'], urldecode($upload_dir.$pic['name']))

nstCactus commented 11 years ago

Thank you for your help. I ended up using a different plugin to manage my uploads so I cannot test it right know but still it's nice to know this is possible with filedrop.

Teemu commented 10 years ago

Why was this closed? jQuery.filedrop should not send invalid filenames by default.