Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > What html element can I use for "download/save file as" box?

Reply
Thread Tools

What html element can I use for "download/save file as" box?

 
 
thisis
Guest
Posts: n/a
 
      10-26-2006
Hi All,

I have an asp/html page that opens a "download/save file as" box,
- e.g. like the element for uploading files <input type="file" .../>


My Question is:

What html element can I use for "download/save file as" box,
Or what alternatives do I have for displaying this operation -
download/save file as" ?

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      10-26-2006
thisis wrote:

> What html element can I use for "download/save file as" box,


<a href="foo"> ... </a>

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      10-26-2006

thisis wrote:

> I have an asp/html page that opens a "download/save file as" box,


It doesn't. What it does is it offers a link to some content (with <a
href="foo" > ) and _that_content_ causes the "save as" dialog to
appear, for some population of users. In particular the HTTP
content-type header that's supplied with this content will trigger it.

You can't control this triggering. It's usually not a response _to_
something definite, but a response when that thing isn't recognised.
Some browsers will now display XML, some (older) browsers won't
recognise it and so they fall back to a default of offering to save it
for you. Much depends on the particular config of particular browsers
for particular users. HTML is always going to be displayed. ZIP files
will be saved. XML could go either way, and you can't predict this.

You can _suggest_ the display / save switch. A well-admined server will
already do this, or you can control it yourself through ASP. They
recognise the file extension and select an apropriate content-type
automatically. Sending "recognised and displayable" content-types
causes display, Sending "known but undisplayable" types causes a save,
as does "unknown" -- in most cases. Remember that this is the
_browser's_ list, and you don't know it exactly.

If you want to "recommend" saving rather than display, then send a
content-type that's likely to do this for most browsers. As you don't
say what your content is, then it's hard to recommend one (although
application/octet-stream might do the trick).

For a simple "quick hack", then just zip the file up and link to the
zipfile.

 
Reply With Quote
 
thisis
Guest
Posts: n/a
 
      10-28-2006

Andy Dingley wrote:
> thisis wrote:
>
> > I have an asp/html page that opens a "download/save file as" box,

>
> It doesn't. What it does is it offers a link to some content (with <a
> href="foo" > ) and _that_content_ causes the "save as" dialog to
> appear, for some population of users. In particular the HTTP
> content-type header that's supplied with this content will trigger it.
>
> You can't control this triggering. It's usually not a response _to_
> something definite, but a response when that thing isn't recognised.
> Some browsers will now display XML, some (older) browsers won't
> recognise it and so they fall back to a default of offering to save it
> for you. Much depends on the particular config of particular browsers
> for particular users. HTML is always going to be displayed. ZIP files
> will be saved. XML could go either way, and you can't predict this.
>
> You can _suggest_ the display / save switch. A well-admined server will
> already do this, or you can control it yourself through ASP. They
> recognise the file extension and select an apropriate content-type
> automatically. Sending "recognised and displayable" content-types
> causes display, Sending "known but undisplayable" types causes a save,
> as does "unknown" -- in most cases. Remember that this is the
> _browser's_ list, and you don't know it exactly.
>
> If you want to "recommend" saving rather than display, then send a
> content-type that's likely to do this for most browsers. As you don't
> say what your content is, then it's hard to recommend one (although
> application/octet-stream might do the trick).
>
> For a simple "quick hack", then just zip the file up and link to the
> zipfile.


Hi Andy Dingley,

Thanks for the detailed guidelines.

my content type are image file types: .bmp,.jpeg,.jpg,.gif - animated
too, partially .wmf

i use ms-internet explorer 6.0, on some web sites. when an image file
is displayed on it,
sometimes a "4 options small bar" - save file, print file, email file,
open my doc's folder - is displayed on the upper left side. sometimes,
a resize image thumb is displayed on the image. the reason is for
posting this topic is, because not all clients use ie,
so i want to have a more clear controled switch on my web page.

Maybe you have a sample code page for your example?

 
Reply With Quote
 
John Dunlop
Guest
Posts: n/a
 
      10-28-2006
Andy Dingley:

[...]

> If you want to "recommend" saving rather than display, then send a
> content-type that's likely to do this for most browsers. As you don't
> say what your content is, then it's hard to recommend one (although
> application/octet-stream might do the trick).


RFC2616 : 19.5.1 says:

| If [Content-Disposition] is used in a response with the
| application/octet-stream content-type, the implied
| suggestion is that the user agent should not display
| the response, but directly enter a `save response
| as...' dialog.

http://www.ietf.org/rfc/rfc2616.txt

Not only do I find this paragraph odd and wholly unnecessary, coming
from (an appendix of) the HTTP spec, but I also regard
Content-Disposition (spit!) on the WWW as pernicious. Don't get me
wrong, I think Content-Disposition has its place - mail rather than the
WWW.

--
Jock

 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      10-28-2006

thisis wrote:
> i use ms-internet explorer 6.0,


What *you* use shouldn't be particularly relevant to your design of a
Web site, since it is going to be viewed in the browsers your users
use. If you follow the standards properly, you have the best chance of
the site being usable to a broad range of users with a broad range of
browsers and settings.

--
Dan

 
Reply With Quote
 
thisis
Guest
Posts: n/a
 
      10-28-2006

Dan wrote:
> thisis wrote:
> > i use ms-internet explorer 6.0,

>
> What *you* use shouldn't be particularly relevant to your design of a
> Web site, since it is going to be viewed in the browsers your users
> use. If you follow the standards properly, you have the best chance of
> the site being usable to a broad range of users with a broad range of
> browsers and settings.
>
> --
> Dan


Hi Dan,

what standars do you mean? - can you supply a link?

 
Reply With Quote
 
Ed Mullen
Guest
Posts: n/a
 
      10-29-2006
thisis wrote:
> Dan wrote:
>> thisis wrote:
>>> i use ms-internet explorer 6.0,

>> What *you* use shouldn't be particularly relevant to your design of a
>> Web site, since it is going to be viewed in the browsers your users
>> use. If you follow the standards properly, you have the best chance of
>> the site being usable to a broad range of users with a broad range of
>> browsers and settings.
>>
>> --
>> Dan

>
> Hi Dan,
>
> what standars do you mean? - can you supply a link?
>


I'd start with
http://www.w3.org/
http://www.w3.org/Consortium/activities
http://www.w3.org/TR/

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Seen it all, done it all, can't remember most of it.
 
Reply With Quote
 
thisis
Guest
Posts: n/a
 
      10-29-2006

Ed Mullen wrote:
> thisis wrote:
> > Dan wrote:
> >> thisis wrote:
> >>> i use ms-internet explorer 6.0,
> >> What *you* use shouldn't be particularly relevant to your design of a
> >> Web site, since it is going to be viewed in the browsers your users
> >> use. If you follow the standards properly, you have the best chance of
> >> the site being usable to a broad range of users with a broad range of
> >> browsers and settings.
> >>
> >> --
> >> Dan

> >
> > Hi Dan,
> >
> > what standars do you mean? - can you supply a link?
> >

>
> I'd start with
> http://www.w3.org/
> http://www.w3.org/Consortium/activities
> http://www.w3.org/TR/
>
> --
> Ed Mullen
> http://edmullen.net
> http://mozilla.edmullen.net
> http://abington.edmullen.net
> Seen it all, done it all, can't remember most of it.


Hi Ed Mullen,

i farmilliar with w3 site, each time i read their recomdies, i can't my
head nor my feet,
it's so complex tearms.

thanks for the other links, i haven't scan them yet.

 
Reply With Quote
 
Ed Mullen
Guest
Posts: n/a
 
      10-30-2006
thisis wrote:
> Ed Mullen wrote:
>> thisis wrote:
>>> Dan wrote:
>>>> thisis wrote:
>>>>> i use ms-internet explorer 6.0,
>>>> What *you* use shouldn't be particularly relevant to your design of a
>>>> Web site, since it is going to be viewed in the browsers your users
>>>> use. If you follow the standards properly, you have the best chance of
>>>> the site being usable to a broad range of users with a broad range of
>>>> browsers and settings.
>>>>
>>>> --
>>>> Dan
>>> Hi Dan,
>>>
>>> what standars do you mean? - can you supply a link?
>>>

>> I'd start with
>> http://www.w3.org/
>> http://www.w3.org/Consortium/activities
>> http://www.w3.org/TR/
>>
>> --
>> Ed Mullen
>> http://edmullen.net
>> http://mozilla.edmullen.net
>> http://abington.edmullen.net
>> Seen it all, done it all, can't remember most of it.

>
> Hi Ed Mullen,
>
> i farmilliar with w3 site, each time i read their recomdies, i can't my
> head nor my feet,
> it's so complex tearms.
>
> thanks for the other links, i haven't scan them yet.
>

But, that does not belie the fact that you need to understand the
concept of standards which you have indicated that you don't understand.
If you make a page for IE, or only evaluate in IE, then you tell us
that you don't "get" standards, which were created to resolve the exact
problem you claim to have.

So. Code/write first for compatibility. All else will follow.


--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Better living through denial.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Element 'ElephantTreeView' is not a known element. This can occur ifthere is a compilation error in the Web site, or the web.config file ismissing. Options Dave ASP .Net 0 07-05-2010 03:54 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
Conversion from a HTML element to table element vinayak Javascript 5 01-18-2008 10:08 AM
Get inner html of an HTML element from codebehind file eggie5@gmail.com ASP .Net 5 10-07-2006 04:04 AM
How to tell VS to wite HTML element's styles in the CSS file automaticly instead of in the body of the HTML file. oranmeir@gmail.com ASP .Net 1 06-09-2006 06:53 AM



Advertisments