<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help upload file 20-100mb in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152358#M5087</link>
    <description>&lt;P&gt;For larger files, you should use chunked uploading. It looks like you're using the Java SDK, so you can use the&amp;nbsp;startUploadFile method, which will decide which kind of uploading to use for you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.8.x/com/dropbox/core/DbxClient.html#startUploadFile(java.lang.String,%20com.dropbox.core.DbxWriteMode,%20long)" rel="nofollow noreferrer"&gt;https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.8.x/com/dropbox/core/DbxClient.html#startUploadFile(java.lang.String,%20com.dropbox.core.DbxWriteMode,%20long)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Dec 2015 23:31:51 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-12-30T23:31:51Z</dc:date>
    <item>
      <title>Help upload file 20-100mb</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152357#M5086</link>
      <description>&lt;P&gt;Hello. I can not upload files larger than 10MB . Can someone help me ? I'm a beginner in Java. Here is my code :&lt;/P&gt;
&lt;PRE&gt;DbxClient client = connect();&lt;BR /&gt;BufferedInputStream file = new BufferedInputStream(new ByteArrayInputStream(body));&lt;BR /&gt;&lt;BR /&gt;try {&lt;BR /&gt;    if (body.length&amp;lt;8381002) {&lt;BR /&gt;        DbxEntry.File uploadedFile = client.uploadFile("/" + name,&lt;BR /&gt;                DbxWriteMode.add(), body.length, file);&lt;BR /&gt;    } else {&lt;BR /&gt;        //* How ???&lt;BR /&gt;    }&lt;BR /&gt;    return true;&lt;BR /&gt;} catch (Exception e){&lt;BR /&gt;    e.printStackTrace();&lt;BR /&gt;    return false;&lt;BR /&gt;}finally {&lt;BR /&gt;    file.close();&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:37:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152357#M5086</guid>
      <dc:creator>Максим Б.</dc:creator>
      <dc:date>2019-05-29T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help upload file 20-100mb</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152358#M5087</link>
      <description>&lt;P&gt;For larger files, you should use chunked uploading. It looks like you're using the Java SDK, so you can use the&amp;nbsp;startUploadFile method, which will decide which kind of uploading to use for you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.8.x/com/dropbox/core/DbxClient.html#startUploadFile(java.lang.String,%20com.dropbox.core.DbxWriteMode,%20long)" rel="nofollow noreferrer"&gt;https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.8.x/com/dropbox/core/DbxClient.html#startUploadFile(java.lang.String,%20com.dropbox.core.DbxWriteMode,%20long)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 23:31:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152358#M5087</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-12-30T23:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help upload file 20-100mb</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152359#M5088</link>
      <description>&lt;P&gt;i find it and it work&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Channel inputChannel = Channels.newChannel(file);&lt;BR /&gt;InputStream inputStream = null;&lt;BR /&gt;inputStream = Channels&lt;BR /&gt;        .newInputStream((ReadableByteChannel) inputChannel);&lt;BR /&gt;ByteBuffer buffer = ByteBuffer.allocate(3276800); //chunk size&lt;BR /&gt;int bytesRead = ((ReadableByteChannel) inputChannel).read(buffer);&lt;BR /&gt;long uploadOffset = bytesRead, offset;&lt;BR /&gt;String uploadId = null;&lt;BR /&gt;while (bytesRead != -1) {&lt;BR /&gt;    buffer.flip();&lt;BR /&gt;    byte[] data = new byte[buffer.remaining()];&lt;BR /&gt;    buffer.get(data);&lt;BR /&gt;    if (uploadId == null) {&lt;BR /&gt;        uploadId = client.chunkedUploadFirst(data);&lt;BR /&gt;    } else {&lt;BR /&gt;        offset = client.chunkedUploadAppend(uploadId, uploadOffset,&lt;BR /&gt;                data);&lt;BR /&gt;        while (offset != -1L) {&lt;BR /&gt;            uploadOffset = offset;&lt;BR /&gt;            offset = client.chunkedUploadAppend(uploadId,&lt;BR /&gt;                    uploadOffset, data);&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;    buffer.clear();&lt;BR /&gt;    bytesRead = ((ReadableByteChannel) inputChannel).read(buffer);&lt;BR /&gt;    uploadOffset += bytesRead;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;client.chunkedUploadFinish("/"+name, DbxWriteMode.add(), uploadId);&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Dec 2015 23:42:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Help-upload-file-20-100mb/m-p/152359#M5088</guid>
      <dc:creator>Максим Б.</dc:creator>
      <dc:date>2015-12-30T23:42:30Z</dc:date>
    </item>
  </channel>
</rss>

