Forum Discussion

Mubasher's avatar
Mubasher
Explorer | Level 4
4 years ago

uploading large files (1GB) using token

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?

  • Здравко's avatar
    Здравко
    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's avatar
      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.");
                },
              });
      • Здравко's avatar
        Здравко
        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!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,948 PostsLatest Activity: 4 hours ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!