Showing posts with label download. Show all posts
Showing posts with label download. Show all posts

Monday, March 26, 2012

set Expires tag for images?

Hi - I want to reduce the download time of various pages by setting the
'Expires' tag for various images to a future date (this will then stop the
browser from re-requesting these for each new session).

I'm hosting on a commercial service so I don't have direct access to IIS
configuration. Is there anyway I can control this from my server-side code?

Thanks,

Paul.Paul W wrote:

> Hi - I want to reduce the download time of various pages by setting
> the 'Expires' tag for various images to a future date (this will then
> stop the browser from re-requesting these for each new session).
> I'm hosting on a commercial service so I don't have direct access to
> IIS configuration. Is there anyway I can control this from my
> server-side code?

Not if the images are served directly by IIS. Your ISP should be able
to change the server configuration to allow for caching.

BTW, you should prefer Cache-Control: max-age over Expires.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@.joergjooss.de
Currently the images ARE directly served by IIS. Can you point me to how
else I could do this so I can set the "Cache-Control: max-age"? Thanks,

Paul.
----
"Joerg Jooss" <news-reply@.joergjooss.de> wrote in message
news:xn0e3b26b6h8ll002@.msnews.microsoft.com...
> Paul W wrote:
>> Hi - I want to reduce the download time of various pages by setting
>> the 'Expires' tag for various images to a future date (this will then
>> stop the browser from re-requesting these for each new session).
>>
>> I'm hosting on a commercial service so I don't have direct access to
>> IIS configuration. Is there anyway I can control this from my
>> server-side code?
> Not if the images are served directly by IIS. Your ISP should be able
> to change the server configuration to allow for caching.
> BTW, you should prefer Cache-Control: max-age over Expires.
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-reply@.joergjooss.de
Paul W wrote:

> Currently the images ARE directly served by IIS. Can you point me to
> how else I could do this so I can set the "Cache-Control: max-age"?
> Thanks,

You could implemment a HttpHandler that serves your images, but this is
really a waste of time. Ask your service provider to change your IIS
configuration.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@.joergjooss.de

Set filename in IE Save As dialog for download file?

Hi,

I store attachment file in SQL Server database and user can download it
later by using a download page e.g. Download.aspx?FileID=1234, the problem
is Internet Explorer always show default filename is "Download.aspx" in it's
"Save As" dialog box, how can I force it to display original uploaded
filename (which I save in database too)?

thank you,Well, for example:

string disHeader = "Attachment; Filename=\"" + filename + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
/C

Cristoffer Crusell
Use this code:
Response.AddHeader("Content-Disposition", "inline;filename=test.xls")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Tien" <tiendq@.gmail.com> wrote in message
news:1d72a31c.0501212036.715c9971@.posting.google.c om...
> Hi,
> I store attachment file in SQL Server database and user can download it
> later by using a download page e.g. Download.aspx?FileID=1234, the problem
> is Internet Explorer always show default filename is "Download.aspx" in
> it's
> "Save As" dialog box, how can I force it to display original uploaded
> filename (which I save in database too)?
> thank you,

Set filename in IE Save As dialog for download file?

Hi,
I store attachment file in SQL Server database and user can download it
later by using a download page e.g. Download.aspx?FileID=1234, the problem
is Internet Explorer always show default filename is "Download.aspx" in it's
"Save As" dialog box, how can I force it to display original uploaded
filename (which I save in database too)?
thank you,Well, for example:
string disHeader = "Attachment; Filename=\"" + filename + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
/C
Cristoffer Crusell
Use this code:
Response.AddHeader("Content-Disposition", "inline;filename=test.xls")
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tien" <tiendq@.gmail.com> wrote in message
news:1d72a31c.0501212036.715c9971@.posting.google.com...
> Hi,
> I store attachment file in SQL Server database and user can download it
> later by using a download page e.g. Download.aspx?FileID=1234, the problem
> is Internet Explorer always show default filename is "Download.aspx" in
> it's
> "Save As" dialog box, how can I force it to display original uploaded
> filename (which I save in database too)?
> thank you,