Hello,
I have a issue I am hoping the community can help me with.
I am trying to allow the user to download a file stored on a server using a web service. Here is my code...
The error I am getting is "Response is not available in this context." I know it is because I am trying to use Httpresponse from a webservice...but I need to know how to make it work...
Thanks for your time!
Michael
I have a issue I am hoping the community can help me with.
I am trying to allow the user to download a file stored on a server using a web service. Here is my code...
VB.NET:
fFile = New System.IO.FileInfo(Path.Combine(strPath, strFile))
If Not fFile Is Nothing Then
If fFile.Exists Then
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFile)
Return successMessage
Response.TransmitFile(Server.MapPath(fFile.FullName))
Response.End()
Return successMessage
Else
Return failMessage
End If
Else
Return failMessage
End If
The error I am getting is "Response is not available in this context." I know it is because I am trying to use Httpresponse from a webservice...but I need to know how to make it work...
Thanks for your time!
Michael