Solved

HTML content-disposition header equivalent in a URL link

Posted on 2013-11-12
3
480 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 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

688 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