How can I change the upload file/folder path?

By default, files are uploaded to the following folder path:

/uploads/{UTC_YEAR}/{UTC_MONTH}/{UTC_DAY}

With the following file name:

{UTC_TIME_TOKEN_INVERSE}{UNIQUE_DIGITS_2}-{ORIGINAL_FILE_NAME}{ORIGINAL_FILE_EXT}

For example:

/uploads/2024/05/20/4kcDPp6sF2-example.jpg

This file path convention allows you to filter your files by year/month/day, and also provides a natural time descending order to your file names (so that new files appear first when listing them).

The {UNIQUE_DIGITS_2} part helps to prevent collisions. If you attempt to upload to an existing file path, a permissions error will occur unless your API key is authorized to overwrite files. Public API keys do not have overwrite permissions, except when allowed by a valid JWT.

For more information on codes like {UTC_YEAR}, please see: Path Variables.

How to change the default file/folder path:

To change the path your files are uploaded to by default:

  1. Sign in to the Bytescale Dashboard.
  2. Navigate to the Security page.
  3. Click "Edit" on the API key you're using.
  4. Click "File Upload Path" on the API key's configuration page.
  5. Edit the Folder and/or File Path.
  6. Click "Save Changes"

How to override the file/folder path during upload:

If you want to specify the file or folder path during upload, pass the fileName and/or folderPath parameters to the Bytescale API/SDK/Upload Widget:

Bytescale Upload Widget

Refer to the Bytescale Upload Widget docs.

Bytescale JavaScript SDK

Refer to the Bytescale JavaScript SDK docs.

Bytescale REST API

For users interacting directly with our REST APIs, please read one of the following:

Tip: Search for the fileName and folderPath parameters in the above documentation.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us