Upload File/Object
Last updated
Last updated
This interface is used to upload files to the cess system. You need to submit the file as form data and use provide the specific field. If the upload is successful, you will get the fid of the file. If you want to encrypt your file, you can specify the cipher field in the header and enter your password (the length cannot exceed 32 characters), and the system will automatically encrypt it.
HTTP Interface:
PUT /file
Request Header:
key | description |
---|---|
Identity signature required: yes
Request Body:
The file is provided in the form.
key | value |
---|---|
Request example:
This interface is used to upload an object, you can write what you want to store directly in the body instead of specifying a file. If the upload is successful, you will get the fid of the object. if you want to encrypt the object, you can specify the "Cipher" field in the header of the request and enter a password (the length can not be more than 32 characters), the system will encrypt it automatically.
HTTP Interface:
PUT /object
Request Header:
Identity signature required: yes
Request Body:
[content]
Request example:
The gateway supports you to store files on the specified miners. When the number of miners you specify is greater than 12, the gateway will randomly store them in the 12 miners you specify. When the number of miners you specify is less than 12, the gateway will store them in the miners you specify first, and then randomly store them in other miners.
The method to specify the storage miner is to specify it by filling in the header of Miner
in the upload interface. All upload interfaces support it.
The example is as follows:
The gateway supports you to set a batch of longitude and latitude coordinate ranges for storage. The number of coordinates cannot be less than 3. The file will be randomly stored in the coordinate range you specify. Set a coordinate point by setting the Latitude and Longitude pair in the request header. Note: Please set the Latitude and Longitude coordinate points in order. All upload interfaces support it.
The example is as follows:
key | description |
---|---|
Bucket
bucket name
Territory
territory name
Cipher(optional)
cipher
file
file[binary]
Bucket
bucket name
Territory
territory name
Cipher(optional)
cipher