Create a new file resource

post/files
Internal-Use Only

Creates a new file resource by passing a file in the form of a multipart request.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2022-03-31T20:00:03.609Z",
3 "modifiedTimeStamp": "2022-03-31T20:00:03.826Z",
4 "createdBy": "sas.audit",
5 "modifiedBy": "sas.audit",
6 "id": "cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
7 "parentUri": "/jobExecution/jobs/b9fe292d-2a4e-434c-8154-5f490b4b9257",
8 "properties": {
9 "LastState": "running",
10 "JobRequest": "",
11 "Job": "b9fe292d-2a4e-434c-8154-5f490b4b9257",
12 "Provider": "casl"
13 },
14 "contentDisposition": "text/plain",
15 "contentType": "text/plain",
16 "description": "Log File for Job b9fe292d-2a4e-434c-8154-5f490b4b9257",
17 "documentType": "log",
18 "encoding": "UTF-8",
19 "links": [
20 {
21 "method": "GET",
22 "rel": "self",
23 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
24 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
25 "type": "application/vnd.sas.file"
26 },
27 {
28 "method": "GET",
29 "rel": "alternate",
30 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
31 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
32 "type": "application/vnd.sas.summary"
33 },
34 {
35 "method": "PATCH",
36 "rel": "patch",
37 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
38 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
39 "type": "application/vnd.sas.file",
40 "responseType": "application/vnd.sas.file"
41 },
42 {
43 "method": "PUT",
44 "rel": "update",
45 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
46 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
47 "type": "application/vnd.sas.file",
48 "responseType": "application/vnd.sas.file"
49 },
50 {
51 "method": "DELETE",
52 "rel": "delete",
53 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7",
54 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7"
55 },
56 {
57 "method": "GET",
58 "rel": "content",
59 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/content",
60 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/content",
61 "type": "text/plain"
62 },
63 {
64 "method": "PUT",
65 "rel": "updateContent",
66 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/content",
67 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/content",
68 "type": "*/*",
69 "responseType": "application/vnd.sas.file"
70 },
71 {
72 "method": "POST",
73 "rel": "copyFile",
74 "href": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/copy",
75 "uri": "/files/files/cddc7f5d-9b30-4bf1-bb2f-6d5e40728cb7/copy",
76 "responseType": "application/vnd.sas.file"
77 },
78 {
79 "method": "POST",
80 "rel": "create",
81 "href": "/files/files",
82 "uri": "/files/files",
83 "type": "*/*",
84 "responseType": "application/vnd.sas.file"
85 }
86 ],
87 "name": "2022-03-31T20:00:03Z-results.log",
88 "size": 742,
89 "searchable": false,
90 "fileStatus": "unlocked",
91 "fileVersion": 0,
92 "expirationTimeStamp": "2022-04-07T20:00:03.651Z",
93 "virusDetected": false,
94 "urlDetected": false,
95 "quarantine": false,
96 "version": 4
97}

Query Parameters

NameTypeRequiredDescription
expirationTimeStamp
string
false

A timestamp that indicates when a file expires. If it is not specified, the file never expires.

parentFolderUri
string
false

The URI of the folder in which to add the file.

recoverable
boolean
false

An indicator specifying if a file is recoverable or not.If a user deleted the file then those files can be recovered.There is a certain retention period till which the file will be retained.

searchable
string
false

An indicator specifying if a file is searchable or not. Defaulted to 'true' indicating file is searchable.

typeDefName
string
false

The type definition name of the file. If the file is associated with folder and the client does not provide the value of this parameter, the file-service tries to find the best possible value using type-registry service. If it fails to find a default value, it defaults to "file".

versioned
boolean
false

An indicator specifying if a file is a version control file or not. If set to true, the endpoint will return first version of the file.

Header Parameters

NameTypeRequiredDescription
Content-Disposition
string
false

The content disposition. This indicates whether the content is expected to be displayed inline in a browser (as a web page or part of a web page) or as an attachment that is downloaded and saved locally. If a filename is specified in the header, it is used as the default name of the file.

Content-Type
string
false

The MIME type for the multipart request. You must specify "multipart/form-data; boundary={boundaryString}". You can specify the actual MIME type of the file by using Content-Type as form data in the request body.

Request Body

NameTypeRequiredDescription
filename
string
false

The name of the file. Clients must specify name of the file as form data in the request body.

file
string
false

The actual file content. The content should be listed in the format of standard form data in the request body. Only one file is permitted in a multipart request.

Responses

StatusMeaningDescription
201CreatedThe file was created and returned in the response body.HeadersSchema
400Bad RequestThe request was not valid. A validation error occurred, and the file cannot be created. Check the response for more information. Here are common reasons for this issue: The file is larger than the permitted size, the file type is not supported, or the multipart request contains more than one file.Schema
409ConflictThe request could not be completed due to a conflict with the current state of the resource. A file with the specified name cannot be created in the folder because the file already exists in that folder.Schema