Return to Snippet

Revision: 63904
at June 17, 2013 05:41 by RobinD


Initial Code
FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte [] buf = new byte[1024];
for(int readNum; (readNum = fis.read(buf)) != -1;) {
    bos.write(buf, 0, readNum);
    System.out.println("read "+ readNum + "bytes,");
}

ByteArrayInputStream inputStream2 = new ByteArrayInputStream(bos.toByteArray());
Entry newEntry = mDBApi.putFile("/uploads/"+file.getName(), inputStream2,
            bos.size(), null, null);

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

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

Initial Title
Uploading binary files to Dropbox

Initial Tags
file, api

Initial Language
Java