Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Rar files not downloading properly

Rar files not downloading properly

Locked

Views: 3,776

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 May 2009, 6:47 PM
#1
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

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:
https://www.acousticsamples.net

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

5 May 2009, 10:27 PM
#2
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

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!

6 May 2009, 3:01 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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:header("Content-Type: [B]A[/B]pplication/octet-stream");to use a lower-case "a", like this:```
header("Content-Type: [B]a[/B]pplication/octet-stream");


I'd be interested in the results you get.
6 May 2009, 11:43 PM
#4
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

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.

7 May 2009, 4:36 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Rar files not downloading properly

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