0

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.

tereško
  • 58,060
  • 25
  • 98
  • 150
Tebogo
  • 11
  • 1
  • Have you googled this? –  Dec 07 '16 at 08:49
  • Possible duplicate of [Transfering file using WCF](http://stackoverflow.com/questions/741378/transfering-file-using-wcf) – rbr94 Dec 07 '16 at 08:51
  • yes I tried googling the solution a couple of times and I cannot find accurate solutions relating to the problem I am having – Tebogo Dec 07 '16 at 08:52
  • 1
    There is no mentioning of any problem, so how can anybody here post a solution that is relating to the problem you are having? – ColinM Dec 07 '16 at 09:09
  • Now that you've provided more detail, could you include the path it is currently looking in for the files, and the path it should be looking in so we can see the differences? – ColinM Dec 07 '16 at 19:38

1 Answers1

0

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.

Mohammad
  • 2,724
  • 6
  • 29
  • 55