Not able to upload doc, docx file Reactnative and React js
I am using cloudinary to upload assets for my mobile app(React-native) and my web app(React js). Everything was working fine until I tried to upload doc and docx files. getting "Unsupported ZIP file" error on both platforms. adding code for React-native this code works fine fdf.
uploadDocFile = (file, callback) => {
if (file) {
const formData = newFormData();
formData.append('tags', ' mobile_upload Docx');
formData.append('upload_preset', 'my_preset');
formData.append('resource_type', 'raw');
formData.append('file', file);
this.props.uploadSingleImage(formData, (status, newDoc = {}) ={
console.log({statusImageUpload:status});
if (status) {
callback(newDoc);
}
});
}
};
1
-
Hi Zain,
Checking through the logs based on the information I got from your support ticket (191869), I could see that you have the following upload parameters:
"tags"=>" mobile_upload Docx", "upload_preset"=>"slashy_admin", "resource_type"=>"image"
You should upload a Docx file using:
"resource_type"=>"raw"
Hope this helps.
1
Post is closed for comments.
Comments
1 comment