Is it possible to stream a file when using the single click of rad button.
For example I've setup a button exactly like the one in the Single Click Button demo but the button never gets enabled after the file is downloaded. I think it is because I'm using response.clear and response.end methods but I'm not sure. Here is the main part of the code in the button. Is there a workaround to this problem. The button is setup correctly because if I remove this code, it works properly.
Thank you,
Brian
For example I've setup a button exactly like the one in the Single Click Button demo but the button never gets enabled after the file is downloaded. I think it is because I'm using response.clear and response.end methods but I'm not sure. Here is the main part of the code in the button. Is there a workaround to this problem. The button is setup correctly because if I remove this code, it works properly.
Dim
downloadBytes
As
Byte
() = pdfConverter.GetPdfFromUrlBytes(URL)
Dim
response
As
System.Web.HttpResponse = System.Web.HttpContext.Current.Response
response.Clear()
response.AddHeader(
"Content-Type"
,
"binary/octet-stream"
)
response.AddHeader(
"Content-Disposition"
,
"attachment; filename="
+ FileName +
"; size="
+ downloadBytes.Length.ToString())
response.Flush()
response.BinaryWrite(downloadBytes)
response.Flush()
response.
End
()
Thank you,
Brian