File Content Type?

Discussion in 'HTML & Website Design' started by BlackIrish, May 15, 2009.

  1. #1
    Hi.

    I have a problem with my website - Some download managers rename the extension file of my .msi installer to an .exe, making the installation unusable.

    So, I got a suggestion that I should change the "content-type parameter" of my file to "application/octet-stream" or "application/x-msi".

    Does anyone know how to do this and where?

    Because I've never seen such a thing :p
     
    BlackIrish, May 15, 2009 IP
  2. zelphics

    zelphics Active Member

    Messages:
    766
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    68
    #2
    I haven't either. What download manager is renaming your file extension?
     
    zelphics, May 15, 2009 IP
  3. BlackIrish

    BlackIrish Active Member

    Messages:
    237
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Internet Download Manager, it's popular so quite a few people are probably having this problem...

    Btw, here is come php code that I've would that supposedly does change the file content type, don I don't know how to use it:

    <?php
    // We'll be outputting a PDF
    header('Content-type: application/pdf');

    // It will be called downloaded.pdf
    header('Content-Disposition: attachment; filename="downloaded.pdf"');

    // The PDF source is in original.pdf
    readfile('original.pdf');
    ?>
     
    BlackIrish, May 16, 2009 IP
  4. BlackIrish

    BlackIrish Active Member

    Messages:
    237
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I guess the php above didn't help?
     
    BlackIrish, May 16, 2009 IP
  5. sparq

    sparq Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You should probably post the source code that is causing this problem.
    Without this sort of information neither I or anyone else is going to be able to help you.
     
    sparq, May 16, 2009 IP
  6. horseshoe

    horseshoe Peon

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i've not either...i'll try it..thank you..nice to know you..:)
     
    horseshoe, May 17, 2009 IP
  7. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    How are you making available the download?

    1. Through a bare link, e.g., <a href="...">

    2. Through a CGI script?

    Tell us more about the method you use.
     
    TechnoGeek, May 18, 2009 IP
  8. BlackIrish

    BlackIrish Active Member

    Messages:
    237
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #8
    I'm using a simple hyperlink, <a href="...> as you have mentioned.

    The hyperlink points to the .msi file found on my hosting.

    But I can change this to anything, CGI, PHP, it's no problem. I just need it to work.
     
    BlackIrish, May 18, 2009 IP
  9. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #9
    In my opinion, you should change to a CGI script if you want to control what type of file you are serving.

    Look at this tutorial:

    Developing a CGI Script

    Good luck.
     
    TechnoGeek, May 19, 2009 IP