cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

uploading large files (1GB) using token

uploading large files (1GB) using token

Mubasher
Explorer | Level 4

I am making a page where the user pastes the URL of the file and I fetch that file make its zip then uploading it to dropbox. it's working fine with the small files such as 150Mb or 250Mb but not with the 1Gb files. I am doing this all without setting up a backend server. Is there a problem with my code that it's not uploading large files to dropbox or it can't be done without setting up a backend server?

6 Replies 6

Здравко
Legendary | Level 20

Hi @Mubasher,

How exactly you are uploading your data? 🤔 Are you using "upload" endpoint in all cases, the point where upload size is limited, or use upload session endpoints (start, append, and finish) for larger files (there is a limit still, but the size is much bigger)? 🧐

Hope the rhetorical question gives you right direction. 😉

Mubasher
Explorer | Level 4

I don't know much about Dropbox but this is the code that I am using in order to upload data.

 

var path =
          "/file" +
          Math.floor(Math.random() * 10000+
          "." +
          file.type.split("/")[1];
        $.ajax({
          data: file,
          crossDomain: true,
          crossOrigin: true,
          type: "POST",
          processData: false,
          contentType: "application/octet-stream",
          headers: {
            Authorization: "Bearer " + dropboxToken,
            "Dropbox-API-Arg"'{"path": "' + path + '"}',
          },
          successfunction (data) {
            console.log(data);
            alert("File uploaded to dropbox.");
          },
          errorfunction (data) {
            console.error(data);
            alert("There was an error uploading to Dropbox.");
          },
        });

Здравко
Legendary | Level 20

@Mubasher wrote:

I don't know much about Dropbox ...


Nobody knows everything. Did you read everything pointed by my links in my previous post? 🤔 Seems not. Do it! Your code falls in 150MB limitation. 😉 Read with more care!

Mubasher
Explorer | Level 4

ok i am reading but my code is working fine for 250Mb but it fails at 1Gb because of my internet i think. Can you tell me that i have to use backend for upload_session? or it can be done without server?

Здравко
Legendary | Level 20

@Mubasher wrote:

... but my code is working fine for 250Mb but it fails at 1Gb because of my internet i think. ...


🙂 The access point, you are using, guarantees work for size up to 150MB. By the way all single transactions are not guaranteed to support transfer of more than 150MB. Of course, this doesn't mean you can't transfer more! It's just not guaranteed. 😉

 


@Mubasher wrote:

... Can you tell me that i have to use backend for upload_session? or it can be done without server?


If I understand correct, you count backed and server usage as the same. I name it little different. You don't need separate server. "Backend" could be realized as a modification of you code. You have to perform sequentially session endpoints calls (create, append, and finish). "Append" steps could be called concurrently, but not before create and not after finish (that's an option - be careful).

Hope this sheds additional light.

Greg-DB
Dropbox Staff

[Cross-linking for reference: https://stackoverflow.com/questions/67035156/can-i-upload-larger-files-1gb-to-dropbox-via-dropbox-to... ]

 

@Mubasher Здравко is correct, the issue is that the /2/files/upload endpoint only supports files up to 150 MB. For larger files, you'll need to use upload sessions like Здравко linked to. The upload session endpoints can be called from either a "front-end" or "back-end". A server is not required to make the API calls.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    Mubasher Explorer | Level 4
What do Dropbox user levels mean?