In web.config,
<add key="Uploads" value="\\\\192.19.165.115\\image_dir\\"/>
C# code:
uploadsPath = (ConfigurationManager.AppSettings["Uploads"].ToString());
Its returning file with below statement
return File("\\\\192.19.165.115\\image_dir\\" + name, System.Net.Mime.MediaTypeNames.Application.Octet, name);
But, it is throwing below error with this line of code.
return File(uploadsPath + name, System.Net.Mime.MediaTypeNames.Application.Octet, name);
Error:
[COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))]
[HttpException (0x80004005): An error occurred while communicating with the remote host. The error code is 0x80070006.]
Both are same paths. Please guide me to solve this issue.
In Web config the value should be this:
<add key="Uploads" value="\\192.19.165.115\image_dir\"/>
User contributions licensed under CC BY-SA 3.0