Page 1 of 1
File upload with single quotes in name
Posted: Mon Dec 12, 2005 8:58 pm
by alex.barylski
Whenever I upload a file which has single quotes
everything before the quote goes bye bye
I have checked the name before I apply ANY clean up routines directly...
So WTF gives?? Is this a PHP thing? Will safe_mode or something trigger auto filename sanitization or something???
It's NOT my code I promise you that...
Or atleast I think I can promise you that
Regards,
Alex
Posted: Mon Dec 12, 2005 9:26 pm
by Ambush Commander
Are you talking about the filename or the actual file?
Posted: Mon Dec 12, 2005 10:44 pm
by alex.barylski
Ambush Commander wrote:Are you talking about the filename or the actual file?
Huh?
The file name...
For instance, if I upload a file called:
Alex's Text Document.txt
What I get back when I check
$_FILES['upload_file']['name'] is
s Text Document.txt...
Make sense now???
The file uploads fine...it's contents, etc...
It's the filename...before any of my code even acts on it....it's stripped of characters preceeding and including the slash...
Just curious if this is a *nix thing, apache or php or possibly my script inadvertently changing it...although I don't know how...cuz like I said...my code ain't doing anything before I echo the contents of
$_FILES
Any ideas??? Not a major issue....but it's buggin' me I don't know whjats going on
Cheers

Posted: Tue Dec 13, 2005 7:00 pm
by Ambush Commander
Unix probably doesn't allow "'" in file names. The moral of the story? Don't rely on the file array to find out what the original name was.
Posted: Wed Dec 14, 2005 12:14 am
by ryanlwh
maybe turn magic_quotes_gpc on