I developed a React Native app with Expo. I'm using USB to connect my phone and everything is going great - fetching/updating/etc. However, I can't upload files. I get this error: Error in uploadFile: [AppwriteException: Network request failed]. The network is OK... Please help.
when im using a react PWA with the same appwrite project it is working.
#React native expo file upload issue
17 messages · Page 1 of 1 (latest)
anyone?
React native expo file upload issue
What's the code?
What are the network logs?
Is the device able to login or make any other things/connect to appwrite?
I'm running into the same issue only there is no error thrown, but no file shows up either.
const uploadImage = async (uri) => {
try {
console.log("Uploading file from URI:", uri);
const fileId = ID.unique();
console.log("Uploading file with ID:", fileId);
const uploadedFile = await storage.createFile(
APPWRITE_BUCKET_ID,
fileId,
uri
);
console.log("Uploaded file:", uri);
return fileId;
} catch (error) {
console.error("Error in uploadImage:", error);
throw new Error("Failed to upload image: " + error.message);
}
};
so that catch never fires, it just returns the fileId
for @ember eagle make sure SSL is setup if you're self hosted. Make sure permissions are correct in your console on that bucket
That's how you solved it?
That got me past the network error, yes
Now, I am not getting file in the console with the above code
Create a new post for your issue
ok
it is a native (react native expo) , i font need ssl for that.
this is the error: : [AppwriteException: Network request failed] . the code is network fail , i think 502, not sure
Is this android?