A file contains a sequence of bytes. Using the Backblaze 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.
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_versionThis operation deletes one version of one file.
b2_download_file_by_idThis operation downloads a specific version of a file.
b2_download_file_by_nameThis operation downloads the most recent version of a file.
b2_get_file_infoThis operation returns information about a file.
b2_hide_fileThis operation hides a file without deleting its data.
b2_list_file_namesThis operation lists the file names in a bucket.
b2_list_file_versionsThis operation lists all of the file versions in a bucket.
b2_upload_fileThis operation uploads a new file (or a version of a file).
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:
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.
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:
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.