cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

RIFF header is removed in uploaded audio file

RIFF header is removed in uploaded audio file

anray
Explorer | Level 3

 I upload .wav file to dropbox with the following code in Android app:

DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial", "en_US");
mClient = new DbxClientV2(config, ACCESS_TOKEN);

InputStream in = new FileInputStream(filePath);
FileMetadata metadata = mClient.files().uploadBuilder("/Folder/" + FILE_NAME).withMode(WriteMode.OVERWRITE)
.uploadAndFinish(in);
Log.d(TAG, "Upload complete " + metadata.getRev());

And when I compare the files (origianl and uploaded) I can see that RIFF header is missing: https://www.screencast.com/t/6e3TwwypR

And as a result file without header is not reccognized and not played, i.e. corrupted.

Why does the header cut out?

1 Reply 1

Greg-DB
Dropbox Staff
The Java SDK just uploads whatever raw data is supplied, in this case via the InputStream supplied to the uploadAndFinish method. In your code, that's the "in" variable. Can you try reading that itself and checking whether or not it has the expected data?
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?