react-native-aws3
react-native-aws3 copied to clipboard
Uploading Audio caf files to aws3
Is it possible to upload audio caf files? I've been trying to do that but the uploaded file ends up being 0 bytes..that's the code:
let file = {
uri: this.recording.uri,
name: "sound-test.caf",
type: "audio/caf",
}
let options = {
keyPrefix: "uploads/" + "admin" + "/tests/",
bucket: "xxxx-xxxx",
region: "us-west-1",
accessKey: "XXXXXX",
secretKey: "XXXXXX",
successActionStatus: 201,
}
RNS3.put(file, options).then(response => {
console.log(response.status);
if (response.status !== 201) {
throw new Error("failed to upload audio to s3");
}
console.log(response.body);
console.log(response.body.postResponse.location);
});
Did you ever resolve this issue?