Encoded Characters in filename in URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Encoded Characters in filename in URL

Post by anjanesh »

I was wondering what are the characters needed to be encoded when sending a filename in the url ?

The script uploaded the 10 images in the 10 file inputs.
After uploading it displays the 10 images uploaded.
Unfortunatley it never showed up any of the images. The uploaded files had names with blanks,-,commas etc etc. So I just changed them to p1.jpg to p10.jpg and it succeeded. So the problem lies in the name of the filenames since Im passing them to genimage.php?url=imagefilename to display the thumb of the image. So I guess imagefilename must be encoded if it contains other chars. I know blank is one such one. What are the other chars needed to forced encoded ?
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

use [php_man]urlencode[/php_man] on the filename.
Post Reply