Hi,
I'm using the script below to upload jpegs and gifs to my web server.
My problem is that whilst its appears to work OK and the images appear on my web site. The image file seems to get corrupted on the server which manifests itself as follows.
1) If I right click on the image (I'm using IE6) and do "Save picture as" it saves it as "untitled.bmp" instead of "myfile.jpg"
2) If I FTP the image back to my local pc and try and open it, I just get "unknown file format" - The file then becomes useless and I can't do anything else with it.
I was wondering if it might have something to do with my script and that I might need specify "jpg" or gif" as a file format (or something like that)
Any suggestions? - My script goes something like this
//--html for form
<form action="putfile.php" method="post" enctype="multipart/form-data" name="form1">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="file" name="thumb_image">
<input type="submit" name="Submit" value="Upload Details">
</form>
//--putfile.php
$uploadfile = $uploaddir_news_th . basename($_FILES['thumb_image']['name']);
move_uploaded_file($_FILES['thumb_image']['tmp_name'], $uploadfile);
Thanks