content-type problem with file uploads

From: Date: Mon, 12 Mar 2001 15:44:12 +0000
Subject: content-type problem with file uploads
Groups: php.general 
Request: Send a blank email to php-general+get-43477@lists.php.net to get a copy of this message
I've been successfully uploading graphic files to a directory on my php server for more than a year. Suddenly, it no longer works, and after a lot of probing, I'm at a loss to determine why. I run PHP4.0.4pl1-3 as an Apache module on RedHat7. Files upload as expected, but PHP no longer provides the content-type as it should following the upload, in the variable: $HTTP_POST_FILES['file']['type']. Furthermore, the uploaded file no longer matches the original file: it has the content type prepended at the start of the uploaded file. For example, a file that starts out like this before the upload: -------------------------------- GIF89aB h ¢ ooorod?.}zqSL7/' ZO{}!ù , B h ÿhj²þ0J ¨ Zdizhª®lë¾pÌn&#64979; B®ï|Îè¿Hc¨hHZÈäCÃÔÐhò <snip> ------------------------------- ....looks like this after being uploaded: -------------------------------- Content-Type: image/gif GIF89aB h ¢ ooorod?.}zqSL7/' ZO{}!ù , B h ÿhj²þ0J ¨ Zdizhª®lë¾pÌn&#64979; B®ï|Îè¿Hc¨hHZÈäCÃÔÐhò <snip> ------------------------------- Clearly, these problems are related -- it seems the content-type header is being sent, but gets interpreted as part of the file instead of a header about the file. I just can't figure out why, especially since this worked as expected on the same hardware/software setup only days ago. Thank you in advance for any thoughts or recommendations!

« previous php.general (#43477) next »