react-native-aws3 icon indicating copy to clipboard operation
react-native-aws3 copied to clipboard

Uploading Audio caf files to aws3

Open ahmdsdk opened this issue 8 years ago • 1 comments

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);
    });

ahmdsdk avatar May 29 '17 14:05 ahmdsdk

Did you ever resolve this issue?

pjammer avatar May 14 '18 17:05 pjammer