PHP upload fails with filename including quote

All others add-ons (Secure FTP, SCP, Flickr, scripts ...).
Post Reply
User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

PHP upload fails with filename including quote

Post by support »

If you have some filenames including quotes such as abc'and''test.zip then PHP upload script could all the beginning. Then the uploaded filename becomes test.zip.

This problem is not related to the upload applet but to the way PHP is setup on your server.
See: http://us3.php.net/features.file-upload

To solve it, you have to turn magic_quotes_gpc to off either in php.ini or in .htaccess.

For php.ini, search for:
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

For .htaccess, put the following line into the .htaccess file:
php_flag magic_quotes_gpc off
See: http://www.php.net/manual/en/security.m ... .php#55935

Hope it helps.

Post Reply