Download a File


Updated: October 9, 2012

Applies To: Windows Server 2012 Essentials

Retrieves the binary content of a file, in bytes.

GET services/builtin/FileContentAccessService.svc/filecontent?path={path}

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

GET HTTP/1.1  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  

HTTP/1.1 200 OK  
Cache-Control: private  
Content-Length: 28675  
Content-Type: application/octet-stream  
Accept-Ranges: bytes  
ETag: "FakeStrongETAG"  
Server: Microsoft-IIS/8.0  
Content-Disposition: attachment; filename="1.cs"  
X-AspNet-Version: 4.0.30319  
X-Powered-By: ASP.NET  
X-Content-Type-Options: nosniff  
Date: Mon, 31 Oct 2011 07:42:33 GMT  
<file content>  

Error CodeError Message
400The path is too long or has unsupported characters (such as *\&#124;"<>).
401Access is denied to the requested resource.
404The path does not exist.

The caller is supposed to read the response stream. The method supports the retrieval of partial content of the file, in which the range of the file is specified by the Range header field in the HTTP request.

Web Service Methods

Community Additions