Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Open Downloads in new window

Open Downloads in new window

Views: 1,121

Results 1 to 5 of 5
13 Mar 2012, 12:20 PM
#1
dustie avatar

dustie

Zen Follower

Join Date:
Nov 2010
Posts:
159
Plugin Contributions:
0

Open Downloads in new window

HI,

I have successfully been able to add (free) Digital downloads to my Webshop.

Everything works great, except that I would like the downloads to open in a new window, so that when a customer closes the download window, it doesn't close my store as well.

Am I missing something in the set up of downloads, or is this option not available?

I have searched the forum for recent posts to my question and haven't been able to find any, so hope someone can help me, or at least point me in the right direction.

I am using version 1.3.9h.

Thank you in advance for your help.

14 Mar 2012, 9:18 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Open Downloads in new window

I think you're seeing something that the rest of us don't see.

What exactly is on the "download window" screen that makes you think they'll want to "close" it?
Normally, in a properly running shop, there is no "download window" that would tempt them to close it. The screen doesn't change ... it just starts the download while leaving your store fully intact, and obviously looking like your store.

Please click Reply below and answer all the questions in the Posting Tips section on that page.

14 Mar 2012, 5:06 PM
#3
dustie avatar

dustie

Zen Follower

Join Date:
Nov 2010
Posts:
159
Plugin Contributions:
0

Re: Open Downloads in new window

Hallo,

Thank you for replying.

As I have never seen or done a digital download with Zencart, I had no way of knowing how it should work.

I don't really understand the technical side of this, and so not really sure what other info to give :(

I set up the download as per instructions with a video. The downloads are PDF files.

After placing order for the DL, there is a text that says:

To download your files click the download button and choose "Save to Disk" from the popup menu.

I think this is where my downloads go wrong??

If I click on the Download button then I don't get a pop up window that prompts to Save to Disk.. it simply opens a whole new window (link), which shows the PDF download.

This is what the new link looks like...

ww.REMOVED/webshop/pub/.zjbgvmyhjcnpiwlkuyi/a725_free.pdf

As I said in my first post, if we close this window, it also closes my site. The only way of going back is using the back button or logging back into the shop.

I hope this makes sense, as I don't really know what other info to give, or explain it differently.

14 Mar 2012, 5:47 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Open Downloads in new window

I'm guessing you don't have this problem when downloading .zip or other file formats.

Your computer has been set up to open PDF files directly in the browser, hence the behavior you're experiencing.

You might be able to get around this by editing your /pub/.htaccess file, changing the following:```

but now allow just certain necessary files:

<FilesMatch ".*.(zip|ZIP|pdf|PDF|mp3|MP3|swf|SWF|wma|WMA|wmv|WMV)$">
Order Allow,Deny
Allow from all

tell all downloads to automatically be treated as "save as" instead of launching in an application directly

(just uncomment the next 2 lines by removing the '#'):

ForceType application/octet-stream

Header set Content-Disposition attachment

</FilesMatch> ```to this instead:``` <FilesMatch ".*\.(zip|ZIP|gzip|pdf|PDF|mp3|MP3|swf|SWF|wma|WMA|wmv|WMV|wav|epub)$"> Order Allow,Deny Allow from all </FilesMatch> <IfModule mod_headers.c> <FilesMatch ".*\.(zip|ZIP|gzip|pdf|PDF|mp3|MP3|swf|SWF|wma|WMA|wmv|WMV|wav|epub)$"> # tell all downloads to automatically be treated as "save as" instead of launching in an application directly # ALERT: ForceType requires Apache2 or later. If using older version of Apache, it will need mod_mime installed. Or just comment out the ForceType line below # (to disable, just comment the next 2 lines by adding a '#' at the beginning of each): ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> </IfModule> ```
14 Mar 2012, 8:51 PM
#5
dustie avatar

dustie

Zen Follower

Join Date:
Nov 2010
Posts:
159
Plugin Contributions:
0

Re: Open Downloads in new window

THANK YOU.... problem solved :) :clap:

For now I have just saved the files as ZIP and it now works as described.

I will also try by editing the text you have given me, but for now I am happy it works as is :)

Thank you once more :)