Dan Holm Posted November 29, 2009 Share Posted November 29, 2009 Hi! I have the following problem: I have a php-script which uploads a file from a html-form but when I upload a file containing an apostrophe (') in it´s filename the upload is unsuccessful. A var_dump() on $_FILES get the following output: array(1) { ["file"]=> array(5) { ["name"]=> string(14) "bla´bla.jpg" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(1) ["size"]=> int(0) } } (spec: charset utf-8, php5.3.0, apache2.2.11) Link to comment https://forums.phpfreaks.com/topic/183320-error-caused-by-apostrophes-in-filename/ Share on other sites More sharing options...
mrMarcus Posted November 29, 2009 Share Posted November 29, 2009 you're probably not escaping those characters at all, are you? try mysql_real_escape_string(), or htmlentities() pay attention to their respective uses. Link to comment https://forums.phpfreaks.com/topic/183320-error-caused-by-apostrophes-in-filename/#findComment-967643 Share on other sites More sharing options...
Dan Holm Posted November 29, 2009 Author Share Posted November 29, 2009 Yeah, that was my first thought as well but I don´t see how/where I could escape them. As I understand it the $_FILES variable is set just as the data is sent so I don´t think escaping the string is a possibility. Or am I missing something? Grateful for any advice Link to comment https://forums.phpfreaks.com/topic/183320-error-caused-by-apostrophes-in-filename/#findComment-967647 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.