My code -
storage.createFile(
BUCKET_ID,
ID.unique(),
file,
[],
(progress) => console.log(progress)
);
After executing this code, nothing gets printed in the console.
can you show more code?
const handleUploadFile = async () => {
try {
await storage.createFile(
BUCKET_ID,
ID.unique(),
file,
[],
(progress) => console.log(progress)
);
} catch (error) {
console.log(error);
}
};
The file is uploaded to the bucket and just the progress callback is not working. Maybe it's not working with appwrite cloud and might work with locally hosted appwrite.
Btw, you can format multi line code using 3 back ticks. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
why don't you give this a try? if it works on localhost, we know that it's an issue with the cloud instance
Okay, I will try the locally hosted version.
let me know! I'm here to help
I tried storage API on the local appwrite install and the progress callback was not working.
Idk, what to do next. I mean, the only code that is responsible for uploading is the handleUploadFile function and there is no problem with it.
just to be sure, you're using js right? I want to try and figure this out lol
Have you tried it out yourself? π
nope, but I'm planning to which is why I want to figure this out lol
Yeah, I am using JavaScript
@safwan Hey, any update?
FYI, multi-line code formats better with 3 back ticks. see https://www.markdownguide.org/extended-syntax/#syntax-highlighting
how big is your file?
I tried uploading multiple files of different sizes like 800 KB, and 5 MB in Slow 3G network throttling mode.
ah I forgot about this mate π I'll get to it now
So we chunk our uploads in 5MB increments. So to see the progress, you'd have to upload bigger than 5MB
This doesn't help me. Images are usually less than 5 MB and with no visual progress indicator the client will go crazy.
The upload progress should be visible for every file. Please add this feedback in your roadmap or any list that appwrite follows.
No problem. I understand we do a lot of things every day. Anyway I got my answer.
You are welcome to create a feature request: https://github.com/appwrite/appwrite/issues/new/choose
Okay, I will create the feature request.
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...