uploading an image in binary
| From: | drparker | Date: | Tue, 05 Nov 2002 18:08:00 +0000 |
| Subject: | uploading an image in binary | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122820@lists.php.net to get a copy of this message | ||
I'm having trouble with a script to upload images, which is baffling me
because a similar script has worked fine on other occasions. I can get
the image file uploaded to the correct directory, but it is uploading in
ASCII and I obviously need it in binary. The file name on the form is
like this:
<input type="file" name="add_imgthumb">
then the code on the php script looks like this:
$uploadpath = 'path/images/';
$source = $_FILES['add_imgthumb']['tmp_name'];
$name = $_FILES['add_imgthumb']['name'];
$dest = $uploadpath.$name;
copy($source, $dest);
simple, i know, but that's the way i want it. What do I have to do to
get the image to be uploaded in binary?