Hi dropbox team,
I have no idea how to upload a larger file (>= 1GB) via upload_session/* API.
Can not find any full example code with that.
APIs:
/upload_session/start
/upload_session/append_v2
/upload_session/finish
Logs:
---- first try ---------------------------------
Step 1:
Request:
curl "/upload_session/start" file="" \
--header "Dropbox-API-Arg: {}"
Response:
status code: 200
JSON:
{
"session_id" = AAA123456;
}
Step 2:
Request:
curl "/upload_session/append_v2" file="test_file_5MB_for_upload.bin" \
--header {\"cursor\": {\"session_id\": \"AAA123456\",\"offset\": 0},\"close\": false}"
Response:
status code: 200
TEXT:
<null>
Step 3:
Request:
curl "/upload_session/finish" file="" \
--header "Dropbox-API-Arg" = "{\"commit\":{\"path\":\"\\/test_file_5MB_for_upload.bin\",\"autorename\":false,\"mute\":true,\"mode\":\"overwrite\"},\"cursor\":{\"offset\":5242880,\"session_id\":\"AAA123456\"}}"
Response:
status code: 200
JSON:
{
"client_modified" = "2016-xx-xxTxx:xx:xxZ";
id = "id:uNFAAA123456";
name = "test_file_5MB_for_upload.bin";
"path_display" = "/test_file_5MB_for_upload.bin";
"path_lower" = "/test_file_5mb_for_upload.bin";
rev = 325399abc05;
"server_modified" = "2016-xx-xxTxx:xx:xxZ";
size = 5242880;
}
---- second try ---------------------------------
Step 1:
Request:
curl "/upload_session/start" file="test_file_5MB_for_upload.bin" \
--header "Dropbox-API-Arg: {}"
Response:
status code: 200
JSON:
{
"session_id" = AAA123456;
}
Step 2:
Request:
curl "/upload_session/finish" file="" \
--header "Dropbox-API-Arg" = "{\"commit\":{\"path\":\"\\/test_file_5MB_for_upload.bin\",\"autorename\":false,\"mute\":true,\"mode\":\"overwrite\"},\"cursor\":{\"offset\":5242880,\"session_id\":\"AAA123456\"}}"
Response:
status code: 200
JSON:
{
"client_modified" = "2016-xx-xxTxx:xx:xxZ";
id = "id:uNFAAA123456";
name = "test_file_5MB_for_upload.bin";
"path_display" = "/test_file_5MB_for_upload.bin";
"path_lower" = "/test_file_5mb_for_upload.bin";
rev = 325399abc05;
"server_modified" = "2016-xx-xxTxx:xx:xxZ";
size = 5242880;
}
---- third try ---------------------------------
Step 1:
Request:
curl "/upload_session/start" file="" \
--header "Dropbox-API-Arg: {}"
Response:
status code: 200
JSON:
{
"session_id" = AAA12345678;
}
Step 2:
Request:
curl "/upload_session/append_v2" file="test_file_1GB_for_upload.bin" \
--header {\"cursor\": {\"session_id\": \"AAA12345678\",\"offset\": 0},\"close\": false}"
Response:
Response:
status code: 413
TEXT:
<DOCTYPE html>
<title>4xx</title>
...
</html>
----------------------------------------------------
Would be very grateful for any suggestion.
Thank you!