Upload a file CDN

The CdnPathType variable is the root folder of the uploaded file in the CDN. By default, it is set to "User". For further information, visit here: https://whitepaper.jframework.io/other-concepts/cdn/cdn-storage

Saves the specified file to the CDN folder with CDN file information.

post
Header parameters
Brand-URLstringRequired

The brand URL of the request. This is used to identify the brand.

Example: YOUR_BRAND_URL
Auth-KeystringRequired

This is used to authenticate the request. If the request is not authenticated, the server will return a 401 Unauthorized response.

Example: YOUR_AUTH_KEY
Body
ZOrderinteger · int64Optional

This is the z-order of the uploaded file. By default, the value is 0. E.g. 1, 2, 3, etc.

UploadFilestring · binaryRequired

This contains the file to upload.

FileNamestringOptional

This is used to change the saving file name. E.g. "profile.jpg", "feedback.png", etc. Note: If this is not set, the file name will be the same as the uploaded file name.

PrefixFolderstringOptional

This is the prefix folder before the file name. E.g. "profile", "assets", etc.

RefObjectstringOptional

This is the object reference of the uploaded file. This is used to reference the object.

RefIdinteger · int64Optional

This is the reference id of the uploaded file. This is used to reference the Id of the object.

NotesstringOptional

This is the notes of the uploaded file. E.g. "Profile picture", "Feedback screenshot", etc.

TagsstringOptional

This is the tags of the uploaded file. E.g. "#MyProfile", "#Feedback", etc.

CdnPathTypestring · enumOptionalPossible values:
TestModebooleanOptional

The test mode of the file upload.

Responses
200
The request was successful.
application/json
post
POST /api/v1/cdn/upload-file HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Auth-Key: text
Content-Type: multipart/form-data
Accept: */*
Content-Length: 172

{
  "ZOrder": 1,
  "UploadFile": "binary",
  "FileName": "text",
  "PrefixFolder": "text",
  "RefObject": "text",
  "RefId": 1,
  "Notes": "text",
  "Tags": "text",
  "CdnPathType": "0 - App",
  "TestMode": true
}
{
  "success": true,
  "statusCode": 200,
  "message": "The request was successful.",
  "data": {
    "fileId": "FILE_ID",
    "fileName": "example.pdf",
    "originalFilename": "document.pdf",
    "prefixFolder": "uploads/documents",
    "relativeURL": "/uploads/documents/example.pdf",
    "url": "https://cdn.example.com/uploads/documents/example.pdf",
    "fileURL": "https://cdn.example.com/uploads/documents/example.pdf",
    "fileExtension": ".pdf",
    "mimeType": "application/pdf",
    "fileSize": 102400,
    "testMode": false
  },
  "errors": []
}

Last updated

Was this helpful?