filestack-js
filestack-js copied to clipboard
Mobile browser upload issue
Sometimes when I try uploading from my Samsung Android (version 10) phone using Chrome browser, it fails.
These are my pickOptions:
const pickOptions = (
func: (img: string) => Promise<void> | void,
setPicIsLoading:
| React.Dispatch<React.SetStateAction<boolean>>
| ((loading: boolean) => void) = () => {},
setError: (message: string) => void = () => {}
) => {
return {
onFileSelected: (file: any) => {
if (file.size > 4032 * 3024) {
throw new Error(
"ファイルが大きすぎます。1MB以下のものを選択してください。"
);
}
},
fromSources: ["local_file_system"],
customText: photoPickerText,
accept: ["image/*" /*"application/*"*/],
transformations: {
crop: {
aspectRatio: 1,
},
rotate: true,
},
uploadInBackground: false,
onUploadDone: async (res: { filesUploaded: { url: string }[] }) => {
try {
await func(res.filesUploaded[0].url);
} catch (err) {
setError(err.response.message || err.message || err);
}
},
onCancel: () => {
setPicIsLoading(false);
},
onFileUploadFailed: (err: any) => {
console.log("FS ERROR", err);
setError(err.response.message || err.message || err);
setPicIsLoading(false);
},
};
};
Seems to throw this error:
Error: FS-Cannot upload file. Start request failed
at new e (filestack.esm.js:41)
at filestack.esm.js:41

Sentry also throws it:

Having same issue on my end