Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-19-2004, 06:01 PM #1
- Join Date
- Oct 2004
- Thanked 0 Times in 0 Posts
uploaded file not the correct mime-type?
I hope this is the right forum to post this question in, as i've been struggling with this issue for several days now.
I have a website that generates a tab-delimited text file, which i called a .olta file. This .olta file is read by a portable electronics device which alters the file. The modified file is then uploaded back to the website.
Here is the block of code for my download.php page
header ('Location: http://' . $_SERVER['HTTP_HOST'] .'/admin/' .$tempfilename);
I can download the file just fine, but when i go to upload it, it tells me it is an "octet-stream" file type, rather than saying it's a text/olta, or even a text/plain.
How can i setup my mime types so that PHP reports that the file is of the correct type (so i can validate that the user uploaded a .olta file and not a virus)?
10-19-2004, 08:35 PM #2
- Join Date
- Aug 2003
- One step ahead of you.
- Thanked 3 Times in 3 Posts
Is there a particular reason ypou care what mime-type? It's still an *.olta file.
If you would send something with the extension .jpg it would have the jpg mime type.
The mime-type for files sent to you is set at the sender so there is not much you can do about it.
(All that is true unless im titaly wrong )