Partager via


Upload a File

 

Applies To: Windows Server 2012 Essentials

Uploads a file to a location where the user has access permissions.

URI Template

POST services/builtin/FileContentAccessService.svc/filecontent?overwrite={overwrite}&path={path}

{overwrite}
true to overwrite any existing file; otherwise, false.

{path}
A network path that begins with the server name, in the format /ServerName/FolderPath/FileName.

Sample Request

POST https://www.contoso.com/services/builtin/FileContentAccessService.svc/filecontent?overwrite=false&path=servername/Company/2.txt HTTP/1.1  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  
Content-Length: ***  
  
<file content>  

Sample Response

HTTP/1.1 201 Created  

Error Codes

Error Code Error Message
400 The path is too long or has unsupported characters (such as *\&#124;"<>).
401 Access is denied to the requested resource.
409 An item already exists with the requested new name.

Remarks

The file content should be put into the stream of the HTTP request. Uploads that can be resumed are not supported.

By default, the maximum size of a file that can be uploaded is 100 MB.

See Also

Web Service Methods