Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to force download

Reply
Thread Tools

how to force download

 
 
greg
Guest
Posts: n/a
 
      09-16-2005
Hi

I have a link on a page that points to a file inside the site that I want to
be downloaded
loke in page_load I write

linkFile.NavigateUrl = Request.ApplicationPath + "/somepath/file.iif";

This file is a text file so when user clicks onthat link it displays in the
browser
the contents of that file (it is a text file although with ext iif)

How do i force browser to display dialog like where to save it?

Thanks
GSL


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      09-17-2005
Yes, you can force a dialog box that will ask the user whether they'd like
to open or save the file:

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever.iif")
Response.AddHeader("Content-Disposition",
"attachment;filename=whatever.iif")
Response.End()

Here are more details:
http://SteveOrr.net/articles/EasyUploads.aspx

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


"greg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I have a link on a page that points to a file inside the site that I want
> to
> be downloaded
> loke in page_load I write
>
> linkFile.NavigateUrl = Request.ApplicationPath + "/somepath/file.iif";
>
> This file is a text file so when user clicks onthat link it displays in
> the
> browser
> the contents of that file (it is a text file although with ext iif)
>
> How do i force browser to display dialog like where to save it?
>
> Thanks
> GSL
>
>



 
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
Nike air force one, air force 1, air force one low cut, air force one abdul_razak@indiatimes.com Digital Photography 2 12-31-2008 04:29 PM
Nike Air Force Ones,Air Force One Air Force One-1 lky52193@gmail.com Computer Support 0 01-17-2008 04:40 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:46 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:34 PM



Advertisments