Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Rar files not downloading properly

    Hi, i just finished the setup of my zen cart, but i have a big problem.
    I've been searching the entire forums as i did to customize my cart, but did not find anything...

    I sell sample libraries which consists in really large files and sometimes i have to split them into parts like rar does.

    When i click on the download button from my account, every browser on my mac tries to open the file as if it was a web page. The only solution is to do right click save target file as and my customers won't figure it out.
    It does not seem to happend with zip files or any other file types but rar.
    Is there a way to make this work properly?


    Here is a link to my website:
    www.acousticsamples.net

    If you want to see how it (doesn't) works, just purchase the free libraries.

  2. #2
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Rar files not downloading properly

    Ok i found the solution myself, it wasn't a zen cart configuration problem, it was my server. SO Just in case it happends to somebody, you have to edit the .htaccess file and addd this simple line:

    AddType application/octet-stream .rar

    or replace rar by the extension you need. This overrides the mime type and tells the browser to always download this kind of files.
    I had to di this even if the rar file type was declared in the mime.types file, it strange, but it worked!

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Rar files not downloading properly

    Hmmm ... Zen Cart already sends the application/octet-stream notation. But, it uses a capital "A".

    Would you mind doing a quick test?

    Edit /includes/modules/pages/download/header_php.php and change the line (I think it's line 121) that says this:
    Code:
    header("Content-Type: Application/octet-stream");
    to use a lower-case "a", like this:
    Code:
    header("Content-Type: application/octet-stream");
    ... and temporarily remove your .htaccess change, and see if the .rar downloads properly without the need for the .htaccess edit?

    I'd be interested in the results you get.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Rar files not downloading properly

    Hi,
    I tried what you suggested, but it did not work. I guess it's because the application octet stream is not linked to the rar file type, but i'm no expert so i might be wrong.
    So that might be a bug in zencart :) Because it works for zip, but i guess 7z or other unusual filetypes would give the same result.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Rar files not downloading properly

    Thanks ... it was just an idea I was researching.
    Thankfully you have a solution for your specific needs.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Allow the download of rar files
    By soundfordesigner in forum General Questions
    Replies: 1
    Last Post: 9 Aug 2011, 03:38 PM
  2. Seting atributes for a big download .rar file splitted in 7 .rar archives
    By popemil in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 22 Aug 2010, 11:08 AM
  3. downloading .rar files no longer works for me after upgrading to 1.3.9
    By r189 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 30 Jul 2010, 09:34 PM
  4. Downloading files after sale does not work?
    By HansieNel in forum General Questions
    Replies: 11
    Last Post: 18 Mar 2009, 05:02 PM
  5. Replies: 0
    Last Post: 21 Feb 2009, 09:07 AM

Posting Permissions

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