Re: How to force download?
From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 04/19/04
- Next message: Steve C. Orr [MVP, MCSD]: "Re: load one or other user control"
- Previous message: Mervin Williams: "DataGrid does not display?"
- In reply to: Miguel Dias Moura: "How to force download?"
- Next in thread: Dan Brussee: "Re: How to force download?"
- Reply: Dan Brussee: "Re: How to force download?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Apr 2004 13:31:10 -0700
Use Response.Writefile to output the PDF file.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclasswritefiletopic.asp
Then add a line of code like this:
Response.AddHeader("Content-Disposition","attachment;filename=myfile.pdf");
The "attachment" specification requests the browser to download the file
instead of opening it. But ultimately it is up to the browser and the user
to decide what they want to do with the file; you don't have 100% control of
this from the server.
-- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net "Miguel Dias Moura" <internetNoSpam@27lamps.com> wrote in message news:ue9X3skJEHA.2380@TK2MSFTNGP09.phx.gbl... > Hello, > > in my web site i display some links to PDF files. This links are loaded from > a database. > Anyway, when i click these links the PDF files are open in the visitors > browser and in Acrobat. > > How can i force the files to be downloaded when the person clicks the link? > I don't want to use zip files. > > Thank You, > Miguel > > >
- Next message: Steve C. Orr [MVP, MCSD]: "Re: load one or other user control"
- Previous message: Mervin Williams: "DataGrid does not display?"
- In reply to: Miguel Dias Moura: "How to force download?"
- Next in thread: Dan Brussee: "Re: How to force download?"
- Reply: Dan Brussee: "Re: How to force download?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|