c# - ASP Web API create directory on server gives access denied -


Text after "div class =" itemprop = "text">

I save the file as a link to create a directory on the server, when I give it access to a directory Is trying to deny the file path in

How do I do this

  public static string CreateFile (string filePath) {string Path = ""; String path path = System.Web.HttpContext.Current.Server.MapPath (""); // rootpath = rootpath. Applestrings (0, root path - tall - cropped); System.IO.DirectoryInfo DirInfo = New System. Io DirectoryInfo (Route Path + Phylax); System.Security.AccessControl.DirectorySecurity DirPermission = New System. Security. AccessControl.DirectorySecurity (); System.Security.AccessControl.FileSystemAccessRule FRule = New System.Security.AccessControl.FileSystemAccessRule ("All", System.Security.AccessControl.FileSystemRights.ReadAndExecute, System.Security.AccessControl.AccessControlType.Allow); DirPermission.AddAccessRule (FRule); If (DirInfo.Exists == incorrect) {System.IO.Directory.CreateDirectory (RootPath + FilePath); } Path = Route Path + Phrase; return path; }  

This is a web API, not a website.

I am uploading a file from a mobile, I have managed to read the part.

Returning Server.MapPath ("") D: \\ home ... \\ API

this Is located on an external server

I tried to run this code locally and it works, but returns this error to the external server.

Alternatively, is there any other way of saving the file as a link? About the issue:

I am uploading a file from a mobile device and I am reading the file as a byte [] service, and I can directly access the byte Do not want to save the database, I just need the URL of the file.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -