Back

chunked upload not working anymore - Appwrite SDK (Web) 14.0.0 / 15.0.0 vs 17.0.0

  • 0
  • Self Hosted
  • Web
  • Storage
VanillaFish
9 Feb, 2025, 21:12

Hi, I’m experiencing an issue with** chunked uploads** after upgrading the** Appwrite Web SDK** from 14.0.0 to 17.0.0.

In version 14.0.0, I implemented resumable uploads by generating a hash based on the file, ensuring the same file always had the same file ID. This worked flawlessly—even after refreshing the browser, the upload would resume from where it left off and complete without issues.

After upgrading to 17.0.0, this functionality no longer works. It appears that Appwrite recognizes existing uploaded chunks (e.g., if the file is split into 10 parts and 4 parts are uploaded, it should continue from part 5). However, after a browser refresh, it starts again from part 1 but only uploads a portion of the file (e.g., up to part 6), and the upload stops before reaching 100%. It seems like the stitching process isn't completing correctly, but that's just my assumption based on the behavior.

I’ve tested multiple SDK versions, and the** last version** where this **worked **as expected was 15.0.0.

For context, I am running the latest self-hosted Appwrite 16.0.0 version on my server.

TL;DR
Developers are facing issues with chunked uploads after upgrading from Appwrite Web SDK 14.0.0 to 17.0.0. The functionality that previously worked well in version 14.0.0 is no longer functioning as expected in the newer versions 15.0.0, 16.x.x, and 17.0.0. Despite finding related GitHub issues that are closed, developers are seeking guidance on resolving the chunked upload problem introduced in SDK 17.0.0 and looking for a proper solution.
VanillaFish
9 Feb, 2025, 21:12

Here’s the code snippet I’m using for the uploads:

TypeScript
export const storage = {
    upload: async (file, cb = (p) => {}) => {
        const user = await account.get();
        const userId = user.$id;

        const hashID = await getFileHash(file);
        console.log("hashID", hashID);

        try {
            const uploadFile = await storage.createFile(
                BUCKET_ID,
                hashID,
                file,
                [
                    Permission.read(Role.user(userId)),
                    Permission.write(Role.user(userId)),
                    Permission.update(Role.user(userId)),
                    Permission.delete(Role.user(userId)),
                ],
                (progress) => { 
                    console.log("progress:", progress);
                    cb(progress);
                }
            );
            await refreshFileList();
            return {
                status: "ok",
                data: uploadFile
            };
        } catch (error) {
            return {
                status: "error",
                message: error.message
            };
        }
    }
};

Could you let me know if there were changes in how chunked uploads are handled in 16.x.x or 17.0.0? Any suggestions on resolving this would be greatly appreciated!

I found two related issues on GitHub, but both have been closed: https://github.com/appwrite/appwrite/issues/8402 https://github.com/appwrite/appwrite/issues/9009

Thanks in advance!

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