...

View Full Version : uploaded file not the correct mime-type?



Gibb
10-19-2004, 05:01 PM
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("Content-type: text/olta");
header ('Location: http://' . $_SERVER['HTTP_HOST'] .'/admin/' .$tempfilename);


In my mime.types file for apache, i have the text/olta olta line (tho i've also tried AddType text/olta .olta and a hundred other things).

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)?

marek_mar
10-19-2004, 07:35 PM
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 ;) )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum