Jump to content

Uploading files with () chars


joquius

Recommended Posts

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.