Update a File
put
/storage/v1/Files
Request
Supported Media Types
- multipart/form-data
Root Schema : schema
Type:
Show Source
object
-
contentType:
string
HTTP content type of the uploaded file.
-
deleteAfter(optional):
integer
Amount of seconds after which the file will be deleted.
-
file:
string
Binary file content.
-
fileName:
string
Name of the file to create. May include path.Example:
filepath/file1.txt
-
filePartName(optional):
string
Name of the file part. Used when the file is in multiple parts.
-
isMultiPartFile(optional):
boolean
Indicates that the file will be made of a collection of files with the same filename, but with different file part names.
-
isPublic(optional):
boolean
Indicates whether the file will be private or public. Only private files are supported currently.Example:
true
Response
Supported Media Types
- application/json
201 Response
File update status details.
Root Schema : FilesResponse
Type:
object
Result of the file upload
Show Source
-
fileName:
string
Name of the created file.
-
fileUrl(optional):
string
Link for accessing the public file.
-
isPublic(optional):
boolean
Indicates whether the file is public or private. Files uploaded using the Files endpoint are private.
Examples
The following example shows how to modify a storage file by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
cURL Command
Note:
The command in this example uses the URL structurehttps://tenant-base-url/resource-path,
where
tenant-base-url
represents the Identity Service URL, and the resource path represents the Identity Service API. See
Send Requests for the appropriate URL structure to use.
curl
-X PUT
-H "Content-Type:multipart/form-data"
-H "Authorization: Bearer <Access Token Value>"
https://tenant-base-url/storage/v1/Files
Example of Request Body
The following shows an example of the request body in JSON format:
[
"------WebKitFormBoundary3fkX18wB95KvCil5\n",
"Content-Disposition: form-data; name=\"fileName\"\n",
"\n",
"files/201512312459/file.csv\n",
"------WebKitFormBoundary3fkX18wB95KvCil5\n",
"Content-Disposition: form-data; name=\"isPublic\"\n",
"\n",
"false\n",
"------WebKitFormBoundary3fkX18wB95KvCil5\n",
"Content-Disposition: form-data; name=\"contentType\"\n",
"\n",
"text/csv\n",
"------WebKitFormBoundary3fkX18wB95KvCil5\n",
"Content-Disposition: form-data; name=\"file\"; \n",
"Content-Type: text/csv\n",
"\n",
"csv or ldif file\n",
"------WebKitFormBoundary3fkX18wB95KvCil5--"
]
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Content-length: 10420\n Content-Type: multipart/form-data; boundary=----WebKitFormBoundary3fkX18wB95KvCil5\n Date: Fri, 25 Mar 2016 17:57:14 GMT
Example of Response Body
The following example shows the contents of the response body in JSON format:
{
"fileName": "files/201512312459/file.csv",
"isPublic": false,
"fileUrl": "https://tenant-base-url/v1/Storage-test/B027/files/201512312459/file.csv"
}