- Print
- DarkLight
Files
- Print
- DarkLight
A file contains a sequence of bytes. Using the Backblaze web UI, you can upload any individual file on your computer to Backblaze B2 Cloud Storage as long as it is between 0 bytes and 5 GiB (5 x 230 or 5,368,709,120 bytes). To upload larger files and data sets, you can use the command-line interface (CLI), the Native API, or an integration, such as Cyberduck. The maximum single file size that you can upload using the CLI or the Native API is 5 GB. For files that are larger than 5 GB, see Large Files.
After you upload a file, you can download it right away or wait years to download it. You can also provide a URL to someone else so they can download the file.
If you upload the same file name more than once, multiple versions of the same file are created. This can be useful for tracking the history of a document. For more information, see File Versions.
The following API calls are related to files:
b2_delete_file_version
This operation deletes one version of one file.b2_download_file_by_id
This operation downloads a specific version of a file.b2_download_file_by_name
This operation downloads the most recent version of a file.b2_get_file_info
This operation returns information about a file.b2_hide_file
This operation hides a file without deleting its data.b2_list_file_names
This operation lists the file names in a bucket.b2_list_file_versions
This operation lists all of the file versions in a bucket.b2_upload_file
This operation uploads a new file (or a version of a file).
File Names
You set a file name when you upload a file. After a file is uploaded, you cannot change this name.
Names should be a UTF-8 string up to 1024 bytes with the following exceptions:
- Character codes below 32 are not allowed.
- DEL characters (127) are not allowed.
- Backslashes are not allowed.
- File names cannot start with /, end with /, or contain //.
The following examples are valid file names:
Kitten Videos
users/beatrice/kitten.jpg
自由.txt
When you download or export files, be aware that the above file name requirements are fairly permissive and may allow names that are not compatible with your disk file system.
For bucket naming rules, click here.
File IDs
In addition to a name, each file that you upload has a unique ID that identifies that specific version of that file. A file ID is no more than 200 characters. To download an older version of a file, you must know its file ID. The following example shows a file ID:
4_zb330e285948b7a6d4b1b0712_f000000000000472a_d20140104_m032022_c001_v0000123_t0104
Identifying File Sizes
Files that you upload to Backblaze B2 are stored and charged in bytes.
To view the size of a file on Windows, right-click the file and select Properties. In the General tab, the file size is listed in the Size field.
For Mac OS 10.6 or higher, the number is listed in Get Info in bytes.
On Linux, file sizes are also reported in bytes.
Duplicate Files and Versions
You are charged for duplicate files and old versions of updated files that are stored in Backblaze B2.