react-native-uploader
react-native-uploader copied to clipboard
Video upload support
Is it possible to upload videos with this plugin? If not, that would be VERY desirable in my book.
If you can upload video already, could we add some documentation so that people know how to do it?
+1
Yes, you can. I've been using this library for the past couple months to upload videos. It essentially works the same as uploading a photo; point to the file on your devices, give it the proper meta data and then upload.
Thanks
@ericcastro92 I tried this library and I am getting error "400"
async doUpload(magazineCoverUri, magazineCoverId) {
await this.refs.viewShot.capture().then(uri => {
this.setState({
img: {
uri: uri,
},
});
});
let files = [
{
name: "cover_image",
filename: "image1.jpg",
filepath: magazineCoverUri,
},
{
name: "design_cover_image",
filename: "image2.jpg",
filepath: this.state.img.uri,
},
];
let opt = {
url:
GLOBAL.API_URL + "/uploadMagazineCoverImage/" + magazineCoverId,
files: files,
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "multipart/form-data",
Authorization: this.state.access_token,
},
};
console.log(opt);
await RNUploader.upload(opt, (err, res) => {
if (err) {
console.log("--------->" + err);
return;
}
console.log(res.status);
console.log("===========================");
// console.log(err);
});
}
Can you add the ability to upload the video in chunks and be able to specify a custom header for each chunk uploaded?