Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    1
    Thanks
    0
    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
    PHP Code:
    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)?

  • #2
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    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 )


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •