Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
March 7, 2008, 4:24 am
rate this thread
it is a valid method (for me) to write programs that are accessable by any
operating system. I have programmed for years, but the only web stuff I
have ever done is very trivial static HTML pages. So far so good.
But I am stuck on how to setup an <href> to download a file from inside
the script. In a static html page, anything the browser doesn't
recognise as a valid script is automatically presented for download. But
in a script everything I try wants to be run as a script.
You should start by defining what you mean by that.
There is no <href> element in HTML, to begin with.
No element or attribute "does" anything. They're data. Data doesn't "do"
things, except in Star Trek.
And markup doesn't reside "inside" a script, and HTML doesn't deal with
"files". Specifically, an href attribute takes a URL value, and whether
a URL gets actually mapped to a file depends on the _server_ (unless you
use file: URLs, which are strictly system-dependent and thus generally
useless on the Web).
What on &Planet; are you talking about?
I don't see why that surprises you.
Maybe you should simply start by explaining in plain terms what you are
doing, and illustrate it with some URLs.
Jukka K. Korpela ("Yucca")
I'm a little confused about exactly what you are doing.
I think you have a script that prints a file. Before you print that
file you'll want to also print the content-type and possibly the content
disposition. You're actual content will start after the first blank line.
For example, here is a typical header for a CSV file that will open
Content-Disposition: inline; filename=some_file.csv
Actual file starts here...