Solved

Force download of file on remote server

Posted on 2008-10-29
2
1,686 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

733 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