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
LVL 2
kintonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nayernaguibCommented:
In ASP .NET, you can both open and display the file using one method call.
The method Response.WriteFile (string) opens the file whose name is specified as the string parameter, and outputs its contents to the user.

_______________

  Nayer Naguib

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nayernaguibCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.