Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not retrieve file for uri data:image/png;base64…suc//AHg//at4MGDGLOrp7ff2T0a8Vk+3jO3P+zr9t5v/AP/Z" #84

Open
codal-mpawar opened this issue Mar 18, 2019 · 3 comments

Comments

@codal-mpawar
Copy link

const img_uri = data:image/png;base64, ${value};
const file = {
uri: img_uri,
name: "image.png",
type: "image/png"
};
const options = {
keyPrefix: "media/public/profile/",
bucket: "asdasdasdsad",
region: "asdsadsad",
accessKey: "asdasdsadsadsadsadadadad",
secretKey: "dasdsadsadsadadasdasdasdsadasd",
successActionStatus: 201
};
RNS3.put(file, options)

@umair-dpl
Copy link

use a suitable converter for base64 instead then pass the uri

@prakhar-mindcrew
Copy link

did you find solution for this ?

@umair-dpl
Copy link

@prakhar-mindcrew
use this library :
import { RNS3 } from "react-native-upload-aws-s3-master";
options = {
keyPrefix:
"media/story/" +
(imagesToUpload[file].type == "video/mp4" ? "video/" : "image/"),
bucket: "your bucket",
region: "your region",
accessKey: "your access key",
secretKey: "your secret key",
successActionStatus: 201,
maxRetries:4
};
let response = await RNS3.put(imagesToUpload[file], options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants