Link to home
Create AccountLog in
Avatar of kinton
kinton

asked on

ASP NET WEB SERVICE RETURN FILE

Hi,

I have a DLL that my web service calls, this DLL will create a file on the fly, it may be a HTML file, XML file, text file etc.  In ASP.NET how can I simply get the webservice to open and display this file?  The DLL passes back the file path.

thanks
ASKER CERTIFIED SOLUTION
Avatar of nayernaguib
nayernaguib
Flag of Egypt image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
You can also do the following trick:

If you have access to the source code of the DLL, you can simply have the DLL call return the file contents instead of the path to the file. Now you can directly display the file using Response.Write() method call.

Otherwise, if you don't have access to the source code of the DLL, you can write a function (whether in another DLL or simply inside your ASP .NET project), that when called, will call the first DLL, open the file whose name is returned by that DLL, and return the file contents to the calling party as an array of bytes or characters, or as a string.

_______________

  Nayer Naguib