Solved

Force download of file on remote server

Posted on 2008-10-29
2
1,677 Views
Last Modified: 2013-11-19
Hi there,

We're trying to create a link that when a user clicks will force the file "Save As" dialog box to pop up, rather than have the file open in the user's browser.

The catch is that the link goes to a remote server that we do not run. I've seen solutions for setting headers, etc. if the file resides on the local server, but is there a way to accomplish this when linking to a file on another server?

Thanks!
0
Comment
Question by:velir
2 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 22835461
Hi velir,

The remote server admins would have to work with you to send the headers to force the download.  Alternately, you can try to script a behavior that transfers the file to your server first, then sends it to user with the correct header to force a download but that would look very slow to the end user (two transfers to get one file).

0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22838137
the "save as" dialog box depends on the USER's system, how they have set up the file links, and which ones are to be viewed by which, or downloaded.  The only really safe file extension almost guaranteed to be downloaded is a .ZIP file extension.  Since the server is remote and you cannot change it, you are out of luck, unless to take the contents of that remote link, ZIP it up into a ZIP file, and put a link to it on YOUR server, and you'd probably need their permission to do this -- but that would solve the problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now