codequest
asked on
MemoryStream as input to file download?
I tried using a memorystream as input to an xml file download, so I wouldn't have to create a disk file (to then delete)....
Response.Clear()
Response.AddHeader("Conten t-Disposit ion", "attachment; filename=" & varFileName)
Response.ContentType = "text/XML"
' Response.WriteFile(varFile Path & varFileName) < the alt way to do it
''--- use memorystream
varMemTab.Position = 0
Dim wrkStreamReader As New StreamReader(varMemTab, Encoding.UTF8)
Dim content As String = wrkStreamReader.ReadToEnd( )
''---- do the write
Response.WriteFile(content )
....but it gave an http exception error like it was processing the markup in the Response.WriteFile(content ) statement.
Might there be a way to make this work?
Any suggestions would be appreciated.
Thanks!
Response.Clear()
Response.AddHeader("Conten
Response.ContentType = "text/XML"
' Response.WriteFile(varFile
''--- use memorystream
varMemTab.Position = 0
Dim wrkStreamReader As New StreamReader(varMemTab, Encoding.UTF8)
Dim content As String = wrkStreamReader.ReadToEnd(
''---- do the write
Response.WriteFile(content
....but it gave an http exception error like it was processing the markup in the Response.WriteFile(content
Might there be a way to make this work?
Any suggestions would be appreciated.
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for input. Still working my way back to this one. I'll keep it alive with posts until I fully resolve.
ASKER
Still working my way back to this...
ASKER
Still working on this, should get to it soon...
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: nauman_ahmed {http:#18054518}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
TheLearnedOne
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: nauman_ahmed {http:#18054518}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
TheLearnedOne
EE Cleanup Volunteer
ASKER