Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TransmitFile doesn't work as expected
Message
De
19/08/2006 16:31:56
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
TransmitFile doesn't work as expected
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01147030
Message ID:
01147030
Vues:
80
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform