Ask a Question related to ASP.NET General, Design and Development.
-
Elrey Ronald V. #1
HELP: How to I download a file without viewing it in ASP.NET?
I need to download a file like MS Word doc
from a web form without viewing it. Something
that goes directly to the 'Save As' dialog.
Right now the browser takes over the displays
the document.
Is this possible?
TIA
[email]luvdotnet@hotmail.com[/email]
Elrey Ronald V. Guest
-
Help! Cannot delete PDF file after viewing.
I have a program written in asp which would view a scanned pdf document and delete it after coping to other folder. It use to work fine until I... -
Viewing PDF file after printing.
Until this last week, Distiller would automatically open the new PDF file for viewing. Now, I have to go to the file location and open manually. I... -
PDF Viewing and Download issues
Since I switched to a mac PowerPook G4 using OSX last week, every time I view a .pdf in Mozilla it puts a copy on my desktop. I'd like to decide... -
Adding a PDF to a Web Page for Download or Viewing
OK, I know its simple, but could anyone please direct me to a tutorial or tell me how to add a pdf file to a web page. I have a Job Application that... -
Viewing a RTF File on Web Site
We have the following problem: There is a RTF file that must be viewed on browser and we have been developed a solution in Java to do it. But the... -
Charles Rumbold #2
Re: How to I download a file without viewing it in ASP.NET?
This is what I do:
// see if s/b downloaded rather than viewed
if( download )
{
Response.AddHeader("Content-Disposition",
"attachment; filename=\"" + theDocument.OriginalFileName + "\"" );
}
// make the reposnse
Response.Clear();
Response.ContentType = theDocument.FileType;
Response.Flush();
Response.WriteFile(theDocument.StoredFilePath);
Response.End();
'download' is a boolean extracted from the query string. Setting the
Content_Disposition and attachment is sufficient to cause the download
save as dialog to open (in IE6 anyway), otherwise it will attempt to
view it in IE6, if no viewer is found in will then download anyway.
HTH
Charles
"Elrey Ronald V." <luvdotnet@hotmail.com> wrote in message
news:4268ec58.0307020604.79229141@posting.google.c om...> I need to download a file like MS Word doc
> from a web form without viewing it. Something
> that goes directly to the 'Save As' dialog.
>
> Right now the browser takes over the displays
> the document.
>
> Is this possible?
>
> TIA
>
> [email]luvdotnet@hotmail.com[/email]
Charles Rumbold Guest



Reply With Quote

