Solved

HTML content-disposition header equivalent in a URL link

Posted on 2013-11-12
3
475 Views
Last Modified: 2013-11-12
is there any way to format a link to click on such that
it will do a SAVE-AS/OPEN  for a CSV file on the server?

i've found Content-Disposition: attachment; filename="<file name.ext>"
but that has to be a part of an HTML file header.   My CSV file is generated and sitting on server disk ready for download.

i suppose i could make a PHP wrapper using that header
and then "playback" the CSV text file to be the HTML page contents.

but is there a more elegant way using a link somehow?
0
Comment
Question by:willsherwood
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 500 total points
ID: 39643289
If the CSV is generated and sitting on a web accessible part of your server (say the root of your site) then all you need is a link to it and it should download:

http://example.com/file.csv
0
 

Author Closing Comment

by:willsherwood
ID: 39643309
thanks - it was a browser setting problem.
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 39643328
Yeah, CSV's are funny that way.  You need to ensure that a bunch of things are in place in order for them to work cross-browser.

I'm glad you found a resolution to your problem.  Thanks for the points!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

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