I'm trying to get a file upload to work in an application I'm developing.
On my local machine I've been using the following to save the file to a folder on a shared resource:
string path = Path.Combine("\\appname\myfolder$", Path.GetFileName(file.FileName));
file.SaveAs(path);
and everything works fine.
(On the 'appname' server, the folder 'myfolder' is in the root (e.g.) c:\myfolder)
When I deploy my project to IIS on the same server (e.g. http:\appname) this no longer works.
As a result I tried to change the code to point to the c drive on the server it would be running from e.g.
string path = Path.Combine("c:\\myfolder", Path.GetFileName(file.FileName));
file.SaveAs(path);
and this didn't work either. Tried a few other things but now lost it completely. Can anybody help?