Hi All,
This is new situation for me how to handle the Special characters in File upload before sending to either php file which handles the file.
I want to change the file name or remove the special characters like single quote (') or Double quote like ("), &, # as i am getting the word broken to php page.
I just want to make it in the client side only as i am using ajax and while sending the request to php the url is breaking.
So please anyone guide me in this situation how to handle this.
Thanks and regards,
DharProg
Special Characters in File upload
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Special Characters in File upload
Use escape() on that portion of the URL. It encodes the special characters for use in a URL. It's similar to the PHP urlencode() function.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Special Characters in File upload
escape() should be avoided for URLs. Use encodeURIComponent() instead
http://xkr.us/articles/javascript/encode-compare/
http://xkr.us/articles/javascript/encode-compare/
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Special Characters in File upload
Good to know, thanks!pytrin wrote:escape() should be avoided for URLs. Use encodeURIComponent() instead
http://xkr.us/articles/javascript/encode-compare/
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Special Characters in File upload
Hi All,
Thanks for your support but i could not find the url where it is generating as it is ajaxupload.js file from Jquery.
How to find and where can i see the url to apply escape?
Please guide me.
Thanks and regards,
DharProg.
Thanks for your support but i could not find the url where it is generating as it is ajaxupload.js file from Jquery.
How to find and where can i see the url to apply escape?
Please guide me.
Thanks and regards,
DharProg.
Re: Special Characters in File upload [Solved]
Hi All,
It is solved with the following solution changing the php.ini setting:
magic_quotes_gpc = off.
If there is any other solution is there please provide me without changing the php.ini.
Thanks for all your support,
Dharprog
It is solved with the following solution changing the php.ini setting:
magic_quotes_gpc = off.
If there is any other solution is there please provide me without changing the php.ini.
Thanks for all your support,
Dharprog