Forums / Setting Up Categories, Products, Attributes / Downloadable .txt file shows as web content

Downloadable .txt file shows as web content

Views: 715

Results 1 to 8 of 8
17 May 2013, 5:25 PM
#1
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Downloadable .txt file shows as web content

Struggling with this for a while now, the nature of the problem makes it really tough to search on keywords so if this is out there please redirect me....

Ive got a downloadable product, its a .txt file. Ive created the attribute name and values.

When I go through checkout (or back in to the product through MY ACCOUNT) and click the download button, I get the tab delimited text file as a populated web page instead of a download that gets saved to disk.

Previously I would get a 404 error, after reading through some issues here ont he forums I found a comment about the .htaccess file in /pub. I found I had to add "txt" to allowable files but then the files started appearing as full web pages.

What am I doing wrong or not doing?

17 May 2013, 5:46 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Downloadable .txt file shows as web content

Make sure that you fixed both .htaccess files in:
/download
/pub

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 May 2013, 8:16 PM
#3
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Re: Downloadable .txt file shows as web content

I did that, no change. I tried it on Chrome and Firefox to make sure it wasnt a browser thing.

I dont even know what else to describe the issue with other than the .txt file opens like you might see a pdf file viewed by the browser.

17 May 2013, 8:47 PM
#4
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Downloadable .txt file shows as web content

Try adding this to the .htaccess file AddType application/octet-stream .txt

17 May 2013, 9:10 PM
#5
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Re: Downloadable .txt file shows as web content

Both in the /pub and the /download directories? Does it matter where in the file?

17 May 2013, 9:35 PM
#6
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Re: Downloadable .txt file shows as web content

Badarac - you da man! Unless you are a wo-man! Thanks, that did it. Which .htaccess file do you think made it work right?

17 May 2013, 11:10 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: Downloadable .txt file shows as web content

creff:

Which .htaccess file do you think made it work right?
Depends on which mode you have your store set for distributing files with. Nothing wrong with setting it in both, in case you change your download delivery method. (See FAQs area for download delivery methods explanations)

.
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.

20 May 2013, 3:42 PM
#8
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Downloadable .txt file shows as web content

creff:

Badarac - you da man! Unless you are a wo-man! Thanks, that did it. Which .htaccess file do you think made it work right?
Glad that worked for you. I am a man, I don't know about da-man. ;-)