1. Create new file in the system
1.1. CURL sample
$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/' -X POST \
-d 'filename=test_file&length=999999' \
--cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" \
-H 'Content-Type: application/x-www-form-urlencoded'
1.2. Request Parameters
Parameter | Description |
---|---|
|
original name of the file |
|
length of the file (in bytes) |
1.3. Response Fields
Path | Type | Description |
---|---|---|
|
|
unique id in the system |
|
|
original name of the file |
|
|
file length |
|
|
login of the file owner |
|
|
total number of uploaded bytes |
1.4. Sample Response
{
"id" : 352,
"filename" : "test_file",
"length" : 999999,
"owner" : "admin",
"uploadedDataLength" : 0
}
2. Upload content of the file
2.1. CURL sample
$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/352:uploadContent' -X POST \
--data-binary @input_file.txt \
--cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" \
-H 'Content-Type: application/octet-stream'
2.2. Request Parameters
Parameter | Description |
---|
2.3. Response Fields
Path | Type | Description |
---|---|---|
|
|
unique id in the system |
|
|
original name of the file |
|
|
file length |
|
|
login of the file owner |
|
|
total number of uploaded bytes |
2.4. Sample Response
{
"id" : 352,
"filename" : "test_file",
"length" : 999999,
"owner" : "admin",
"uploadedDataLength" : 24
}
3. Get info about file
3.1. CURL sample
$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/353' -X GET \
--cookie "MINERVA_AUTH_TOKEN=xxxxxxxx"
3.2. Path Parameters
Parameter | Description |
---|---|
|
file id |
3.3. Response Fields
Path | Type | Description |
---|---|---|
|
|
unique id in the system |
|
|
original name of the file |
|
|
file length |
|
|
login of the file owner |
|
|
total number of uploaded bytes |
3.4. Sample Response
{
"id" : 353,
"filename" : "test_file",
"length" : 11,
"owner" : "admin",
"uploadedDataLength" : 11
}