Back

Upload Progress callback is not working with Appwrite cloud

  • 0
  • Web
  • Storage
Vishal Lohar
20 Mar, 2023, 03:21

My code -

TypeScript
storage.createFile(
        BUCKET_ID,
        ID.unique(),
        file,
        [],
        (progress) => console.log(progress)
      );

After executing this code, nothing gets printed in the console.

TL;DR
The user is experiencing an issue with the upload progress callback not working with Appwrite cloud. They suggest adding the feedback to the roadmap. Another user recommends chunking uploads larger than 5MB to see the progress. The user also mentions trying the locally hosted version of Appwrite and formatting multiline code. The user's code to handle the upload file is provided, but the progress callback is not working as expected. No solution is provided in the thread.
safwan
20 Mar, 2023, 03:42

can you show more code?

Vishal Lohar
20 Mar, 2023, 04:07
TypeScript
const handleUploadFile = async () => {
    try {
      await storage.createFile(
        BUCKET_ID,
        ID.unique(),
        file,
        [],
        (progress) => console.log(progress)
      );
    } catch (error) {
      console.log(error);
    }
  };
Vishal Lohar
20 Mar, 2023, 04:08

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.

Drake
20 Mar, 2023, 04:13

Btw, you can format multi line code using 3 back ticks. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

safwan
20 Mar, 2023, 04:14

why don't you give this a try? if it works on localhost, we know that it's an issue with the cloud instance

Vishal Lohar
20 Mar, 2023, 04:15

Okay, I will try the locally hosted version.

safwan
20 Mar, 2023, 04:16

let me know! I'm here to help

Vishal Lohar
20 Mar, 2023, 05:11

I tried storage API on the local appwrite install and the progress callback was not working.

Vishal Lohar
20 Mar, 2023, 05:12

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.

safwan
20 Mar, 2023, 05:18

just to be sure, you're using js right? I want to try and figure this out lol

Drake
20 Mar, 2023, 05:27

Have you tried it out yourself? 😜

safwan
20 Mar, 2023, 05:27

nope, but I'm planning to which is why I want to figure this out lol

Vishal Lohar
20 Mar, 2023, 10:22

Yeah, I am using JavaScript

Vishal Lohar
23 Mar, 2023, 15:30

@safwan Hey, any update?

Drake
23 Mar, 2023, 17:31

FYI, multi-line code formats better with 3 back ticks. see https://www.markdownguide.org/extended-syntax/#syntax-highlighting

Drake
23 Mar, 2023, 17:31

how big is your file?

Vishal Lohar
24 Mar, 2023, 05:06

I tried uploading multiple files of different sizes like 800 KB, and 5 MB in Slow 3G network throttling mode.

safwan
24 Mar, 2023, 05:21

ah I forgot about this mate πŸ˜… I'll get to it now

Drake
24 Mar, 2023, 05:45

So we chunk our uploads in 5MB increments. So to see the progress, you'd have to upload bigger than 5MB

Vishal Lohar
25 Mar, 2023, 15:49

This doesn't help me. Images are usually less than 5 MB and with no visual progress indicator the client will go crazy.

Vishal Lohar
25 Mar, 2023, 15:50

The upload progress should be visible for every file. Please add this feedback in your roadmap or any list that appwrite follows.

Vishal Lohar
25 Mar, 2023, 15:51

No problem. I understand we do a lot of things every day. Anyway I got my answer.

Drake
25 Mar, 2023, 15:52

You are welcome to create a feature request: https://github.com/appwrite/appwrite/issues/new/choose

Vishal Lohar
25 Mar, 2023, 15:53

Okay, I will create the feature request.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more