Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TransmitFile doesn't work as expected
Message
From
19/08/2006 16:31:56
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
TransmitFile doesn't work as expected
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01147030
Message ID:
01147030
Views:
79
I have two XML files on disk. One is a Word file and the other one is an Excel file. From Windows Explorer, if I click on them, either Word or Excel is launched and I can access the file. But, if I use the following code to serve the file to the user in the browser, which makes use of the TransmitFile() approach, neither Word or Excel can open the file.
            lcFile = oApp.GetProcess("Transmit")
            oApp.oResponse.ContentType = "application/x-unknown"
            oApp.oResponse.AddHeader("Content-Disposition", "attachment;filename=" + lcFile)
            oApp.oResponse.TransmitFile(cCacheFat + lcSubDirectoryFat + lcFile)
It seems the browser is doing something to the file which makes it unreadable by Word and Excel. In Word, an error about an incorrect document syntax is thrown. In Excel, an unknown error is thrown. Can someone explain why I have no problem opening those XML files in Word or Excel from the Windows Explorer but can't from the browser?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform