PHP Download Script

Discussion in 'PHP' started by EnDLeSs_27, Jun 23, 2008.

  1. #1
    Hey,

    I have a download script on my site which allows users to download files of my server.

    But their is one problem some of the files are in .avi format. And they can only be downloaded when using Firefox.

    If you use IE it wont download and just takes them to a "page cannot be displayed" error. And this only happens if they are in .avi format. Zip or rar format download fine on both browsers. AVI doesn't work with IE

    Any idea why this is happening?
     
    EnDLeSs_27, Jun 23, 2008 IP
  2. samehzone

    samehzone Guest

    Best Answers:
    0
    #2
    a stupid solution right click + save target as
     
    samehzone, Jun 23, 2008 IP
  3. EnDLeSs_27

    EnDLeSs_27 Active Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Yes, That works but a better solution would be more useful.
     
    EnDLeSs_27, Jun 23, 2008 IP
  4. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Use content-disposition if it's PHP.
     
    Dondon2d, Jun 23, 2008 IP
  5. EnDLeSs_27

    EnDLeSs_27 Active Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Well.. I tried putting this code with no luck.

    
    header('Content-Disposition: attachment;');
    PHP:
    By the way it is several files not just one.
     
    EnDLeSs_27, Jun 23, 2008 IP
  6. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Your code is lacking. If it is several files then just put variables in the attachment field.
     
    Dondon2d, Jun 23, 2008 IP
  7. EnDLeSs_27

    EnDLeSs_27 Active Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #7
    What do you mean by putting variables?

    This is how it looks like

    Public_html/Folder1/Several_files.avi /zip /rar
    Public_html/Folder2/Several_files.avi /zip /rar
    Public_html/Folder3/Several_files.avi /zip /rar
     
    EnDLeSs_27, Jun 23, 2008 IP