Posted By

RobinD on 06/17/13


Tagged

file upload binary api dropbox


Versions (?)

Uploading binary files to Dropbox


 / Published in: Java
 

URL: http://stackoverflow.com/questions/10153640/uploading-binary-files-using-dropbox-java-api

Uploading a binary file(like .doc) to Dropbox. I tried with .ics and it worked.

  1. byte [] buf = new byte[1024];
  2. for(int readNum; (readNum = fis.read(buf)) != -1;) {
  3. bos.write(buf, 0, readNum);
  4. System.out.println("read "+ readNum + "bytes,");
  5. }
  6.  
  7. ByteArrayInputStream inputStream2 = new ByteArrayInputStream(bos.toByteArray());
  8. Entry newEntry = mDBApi.putFile("/uploads/"+file.getName(), inputStream2,
  9. bos.size(), null, null);

Report this snippet  

You need to login to post a comment.