PDF Download problem;

G

Guest

Im using the following code for downloading attachments in web page, however
I get the error "the file is damaged etc". But when I open directly from the
folder it opens,


***********
Dim myFileInfo As New FileInfo(sender.CommandArgument)
Dim myFilePath As String =
System.Configuration.ConfigurationManager.AppSettings("UploadFolder").ToString & "\" & myFileInfo.Name
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
Response.ContentType = "application/pdf"
HttpContext.Current.Response.AppendHeader("content-disposition",
"attachment;filename=" & myFileInfo.Name)
Response.WriteFile(myFilePath)
Response.End()

**********

Any thoughts are welcome;
 
G

Guest

Hi,

Yes, the application uses SSL. Is this is the reason.,

what is the workaround.?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top