I am working on a FileSystemProvider that will allow writing to a physical or shared drive. Most of the functionality seems to be working but the StoreFile method is having issues.
Below is the code I am using
the file.SaveAs(physicalPath) throws an access denied exception. The File.Create(...) works and creates the file so it seems that iis has access to create files.
I am also able to create/delete/move folders and delete files (only tried to delete and upload files).
Am I missing something here that is causing file.SaveAs to not work properly?
Below is the code I am using
public override string StoreFile(Telerik.Web.UI.UploadedFile file, string path, string name, params string[] arguments)
{
var virtualSavePath = Path.Combine(path, name);
var physicalPath = GetPhysicalFromVirtualPath(path);
File.Create(Path.Combine(physicalPath, "joshtest"));
if (physicalPath == null)
return string.Empty;
file.SaveAs(physicalPath);
// Returns the path to the newly created file
return virtualSavePath;
}
the file.SaveAs(physicalPath) throws an access denied exception. The File.Create(...) works and creates the file so it seems that iis has access to create files.
I am also able to create/delete/move folders and delete files (only tried to delete and upload files).
Am I missing something here that is causing file.SaveAs to not work properly?