I have made an api using Webapi 2. It's controller calls to service which calls to repository.
I have Post method where in repository I am executing a url to get a document stream which I am eventually saving into a location HostingEnvironment.MapPath("~/Uploads/") + documentname;
.
This location is used in repository code to save the stream into file using the location and accessing through this location only:
using (var fileStream = new FileStream(document.DocumentPath, FileMode.Open, FileAccess.Read))
{
....
}
I need to do this because other api call needs to use this file's stream again for further processing.
Everything works fine when I have an instance of server running in my local machine, however when this service is hosted into a server I am receiving a 500 Internal Server Error. FileNotFoundException.
I do not have the access to server So I couldn't figure what could actually be the cause for it. My thinking is that my local file system is accessible to service, but I might need to have some extra permissions setup in server. Any thoughts on this would be really appreciated.