1. Create new file in the system
1.1. CURL sample
$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/' -i -X POST \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'filename=test_file&length=999999' \
--cookie "MINERVA_AUTH_TOKEN=xxxxxxxx"
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" : 223,
"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/223:uploadContent' -i -X POST \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data=test_content' \
--cookie "MINERVA_AUTH_TOKEN=xxxxxxxx"
2.2. Request Parameters
Parameter | Description |
---|---|
|
content to append |
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" : 223,
"filename" : "test_file",
"length" : 999999,
"owner" : "admin",
"uploadedDataLength" : 17
}
3. Get info about file
3.1. CURL sample
$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/224' -i -X GET
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" : 224,
"filename" : "test_file",
"length" : 11,
"owner" : "admin",
"uploadedDataLength" : 11
}