joquius Posted December 6, 2006 Share Posted December 6, 2006 I have the following little quirk (upload script):[code]$file_name = basename ($_FILES['image']['name']);$ul_dir = "/something_or_other/";$ul_name = $ul_dir.$file_name;move_uploaded_file ($_FILES['image']['tmp_name'], $ul_name);getimagesize ($image_dir.$file_name); // $image_dir is defined elsewhere[/code]What happens is I get an error on the getimagesize() when the file name contains brackets or weird chars. Now I might turn out to be quite the dunce here, but is this to do with getimagesize or the request itself?This is the error I get: "[<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request"I don't usually get this error from getimagesize if the file doesn't exist.Is this to do with the upload or the php function? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 6, 2006 Share Posted December 6, 2006 Have you tried:[code]getimagesize ("$image_dir"."$file_name");[/code]? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Author Share Posted December 6, 2006 hmm...? that's quite unneccesaryThis is a working script with a quirk only when the file name has brackets Quote Link to comment Share on other sites More sharing options...
papaface Posted December 6, 2006 Share Posted December 6, 2006 Ah sorry. I didnt read your question properly.Im not entirely sure on this one. I think you would probably have to make a function to escape the special characters. Someone else will be able to guide you better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.