I have a file on my website, that i wish the people using the site to be able to Download rather than having it open itself up in the Browser window (it is an Excel file!)
Save it as a zip archive. In addition to having browsers prompt for a download, you'll also save space on your server and bandwidth for your users. These are all Good Things.
Cheers,
Edward
Like Lovecraft? Know Photoshop? Got time for the Unspeakable?
What do you estimate the percentage of your users who are using Excel but don't have WinZip? It doesn't matter whether or not you use WinZip (you can always provide a link on the site to download it), as long as you have a suffix the browser does not recognize (another example:
Code:
.spreadsheet
)
When a browser hits a zip archive, it automatically prompts the user for a download. This is because the browser only attempts to run the file in the browser environment when it knows that the file is tied to some kind of helper application, such as Microsoft Word, Adobe Acrobat Reader, Microsoft Excel, etc. WinZip is not typically identified by a browser as a helper application, therefore the browser doesn't know how to "display" it, therefore the browser simply prompts the user.
It doesn't matter if it's a tiny file or not, zipping it will force the download prompt and that's what I understood your need to be. Okay, you won't save a lot more bandwidth, but that was a bonus anyway.
On the other hand, if it's that tiny a file, you could always put the data on an HTML page...
Cheers,
Edward
Like Lovecraft? Know Photoshop? Got time for the Unspeakable?
Cheers,very helpful, and yes i am new to web development!
The Data is already on a page,
but some of the users will want it on Excel , for a variety of reasons!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.