REST Files

<back to all web services

Files

GET the File or Directory info at {Path}
POST multipart/formdata to upload a new file to any {Path} in the /ReadWrite folder
PUT {TextContents} to replace the contents of a text file in the /ReadWrite folder

The following routes are available for this service:
All Verbs/files
All Verbs/files/{Path*}
Files Parameters:
NameParameterData TypeRequiredDescription
PathpathstringNo
TextContentsquerystringNo
ForDownloadqueryboolNo
FilesResponse Parameters:
NameParameterData TypeRequiredDescription
DirectoryformFolderResultNo
FileformFileResultNo
ResponseStatusformResponseStatusNo
FolderResult Parameters:
NameParameterData TypeRequiredDescription
FoldersformList<Folder>No
FilesformList<File>No
Folder Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ModifiedDateformDateTimeNo
FileCountformintNo
File Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ExtensionformstringNo
FileSizeBytesformlongNo
ModifiedDateformDateTimeNo
IsTextFileformboolNo
FileResult Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ExtensionformstringNo
FileSizeBytesformlongNo
ModifiedDateformDateTimeNo
IsTextFileformboolNo
ContentsformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /files HTTP/1.1 
Host: restfiles.netcore.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<Files xmlns="http://schemas.datacontract.org/2004/07/RestFiles.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ForDownload>false</ForDownload><Path>String</Path><TextContents>String</TextContents></Files>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FilesResponse xmlns="http://schemas.datacontract.org/2004/07/RestFiles.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Directory xmlns:a="http://schemas.datacontract.org/2004/07/RestFiles.ServiceModel.Types"><a:Files><a:File><a:Extension>String</a:Extension><a:FileSizeBytes>0</a:FileSizeBytes><a:IsTextFile>false</a:IsTextFile><a:ModifiedDate>0001-01-01T00:00:00</a:ModifiedDate><a:Name>String</a:Name></a:File></a:Files><a:Folders><a:Folder><a:FileCount>0</a:FileCount><a:ModifiedDate>0001-01-01T00:00:00</a:ModifiedDate><a:Name>String</a:Name></a:Folder></a:Folders></Directory><File xmlns:a="http://schemas.datacontract.org/2004/07/RestFiles.ServiceModel.Types"><a:Contents>String</a:Contents><a:Extension>String</a:Extension><a:FileSizeBytes>0</a:FileSizeBytes><a:IsTextFile>false</a:IsTextFile><a:ModifiedDate>0001-01-01T00:00:00</a:ModifiedDate><a:Name>String</a:Name></File><ResponseStatus xmlns:a="http://schemas.servicestack.net/types"><a:ErrorCode>String</a:ErrorCode><a:Message>String</a:Message><a:StackTrace>String</a:StackTrace><a:Errors><a:ResponseError><a:ErrorCode>String</a:ErrorCode><a:FieldName>String</a:FieldName><a:Message>String</a:Message><a:Meta xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><b:KeyValueOfstringstring><b:Key>String</b:Key><b:Value>String</b:Value></b:KeyValueOfstringstring></a:Meta></a:ResponseError></a:Errors><a:Meta xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><b:KeyValueOfstringstring><b:Key>String</b:Key><b:Value>String</b:Value></b:KeyValueOfstringstring></a:Meta></ResponseStatus></FilesResponse>