?
Solved

HTML content-disposition header equivalent in a URL link

Posted on 2013-11-12
3
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

800 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