- SDK Version: 42.0.1
- Platforms(Android/iOS/web/all): android
this is my code
const _pickDocument = async() => {
let result = await DocumentPicker.getDocumentAsync({copyToCacheDirectory:false,type:'application/pdf'})
.then(response=>{
if (response.type == 'success') {
let { name, size, uri, tmp_name, type } = response;
let nameParts = name.split('.');
let fileType = nameParts[nameParts.length - 1];
var fileToUpload = {
name: name,
type: mime.getType(fileType),
size: size,
// uri: Platform.OS === 'ios' ? uri : "file://"+uri,
uri: Platform.OS === 'ios' ? uri : uri,
// uri:("file:///"+uri.split("file:/").join("")),
};
console.log(fileToUpload, '...............file')
setDoc(fileToUpload);
}
})
.catch(error=>{
console.log(error)
throw error
})
}
const submitDoc= async()=>{
const url = "your url";
if(kategoriValue==null){
alert("bagian * wajib diisi");
return;
}
setIsLoading(true)
axios.post(url, docFormData,{
headers:{
Accept: 'application/json',
'Content-Type':'multipart/form-data'
}
}).then(response=>{
console.log(response)
setIsLoading(false)
alert(response.data)
}).catch(error=>{
console.log(error)
})
}
I want to ask if there is a limit in sending a document. Why do the file failed to send to url if the file size is more than 1.8 MB? Is there any way to increase the size limit? Thank you.