Creates a new file in the specified folder with the title specified in the request.
Name | Description | Type | Example |
folderId
sent in url
|
Folder ID | number | 1234 |
Title
sent in body
|
File title | System.String | |
TemplateId
sent in body
|
Template file ID | System.Int32 | |
EnableExternalExt
sent in body
|
Specifies whether to allow the creation of external extension files or not | System.Boolean | |
FormId
sent in body
|
Form ID | System.Int32 |
If a file extension is different from DOCX/XLSX/PPTX and refers to one of the known text, spreadsheet, or presentation formats, it will be changed to DOCX/XLSX/PPTX accordingly. If the file extension is not specified or is unknown, the DOCX extension will be added to the file title.
POST api/2.0/files/1234/file Host: yourportal.onlyoffice.com Content-Type: application/json Accept: application/json { "Title": "some text", "TemplateId": 1234, "EnableExternalExt": true, "FormId": 1234 }
New file information
application/json
{ "status": 0, "response": { "FolderId": 1234, "Version": 1234, "VersionGroup": 1234, "ContentLength": "some text", "Mute": true, "ViewUrl": "some text", "WebUrl": "some text", "FileExst": "some text", "Comment": "some text", "ThumbnailUrl": "some text", "LockedBy": "some text", "DenyDownload": true, "DenySharing": true } }
text/xml
<result> <status>0</status> <response> <FolderId>1234</FolderId> <Version>1234</Version> <VersionGroup>1234</VersionGroup> <ContentLength>some text</ContentLength> <Mute>True</Mute> <ViewUrl>some text</ViewUrl> <WebUrl>some text</WebUrl> <FileExst>some text</FileExst> <Comment>some text</Comment> <ThumbnailUrl>some text</ThumbnailUrl> <LockedBy>some text</LockedBy> <DenyDownload>True</DenyDownload> <DenySharing>True</DenySharing> </response> </result>