I
I
Ilya Beloborodov2016-11-03 17:37:24
linux
Ilya Beloborodov, 2016-11-03 17:37:24

How to upload a large file via cURL?

First I tried like this:

curl -X POST -d https://content.dropboxapi.com/2/files/alpha/upload \
           --header 'Authorization: Bearer token' \
           --header 'Content-Type: application/octet-stream' \
           --header 'Dropbox-API-Arg: {"path":".folder."}' \
           --data-binary @'/backup/file.zip' \

In this scenario, the files are loaded, but if the file is <= 100mb, if more, then the memory limit error.
Then they advised me something like this
cat /backup/file.zip | curl -X POST  https://content.dropboxapi.com/2/files/alpha/upload \
          --header 'Authorization: Bearer token' \
          --header 'Content-Type: application/octet-stream' \
          --header 'Dropbox-API-Arg: {"path":"/path/file.zip"}' \
          --data-binary @-'

That doesn't work. Please tell me how to send large files. Very necessary. I have already reviewed 30 pages of Google ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Ne-Lexa, 2016-11-03
@kowap

Use Dropbox-Uploader , you can upload gigabyte files without any problems, via Dropbox'a API.

D
dzubchik, 2016-11-03
@dzubchik

Have you read the note in the documentation ? There is a limit of 150 MB.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question