简体   繁体   中英

Reading files from wcf services

Hello I am new to web services using WCF,how can I read files stored in a local directory inside my WCF application, I want to be able to read files inside my service application into my client application

I do not want to download files but view them In my client web application, I tried using HttpContext.Current.Server.MapPath(path) but my client website states directory not found since it is looking on local directory of the website

Thank you.

reading file in WCF service is just like other projects. you can use File.ReadAllBytes or File.OpenRead . note: you have to set appropriate permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM