Back

Doubts Regarding Storage Chunk Upload

  • 0
  • Storage
Vedsaga
27 Nov, 2023, 03:57

Scenario 1: User Closes the App Midway Through Upload

If a file is 100MB which mean 20 chunks.

If the user closes the app after 10 chunks (out of 20) have been uploaded:

What happen those 10 chunks which where uploaded? Does it get deleted immediately if connection disconnected or does it get store in cache for some time? If yes, for how long?

Scenario 2: Upload Interrupted During a Chunk This only applies if Answer of above is yes.

When chunk being partial upload, let say 11th chunk and internet get disconnect or user close the app, does those partial uploaded portion of 11th chunk is stored or not ? If not, then I guess need to reuploaded the chunk 11th?

Finally, so when does the file is created in the bucket, when all the chunks being uploaded correct?

TL;DR
The user is asking about storage chunk upload and has the following questions: 1. Can the SDKs support resuming an upload using the `Function(UploadProgress)` method? 2. How are chunk files stored in Appwrite and when are incomplete files deleted? 3. What happens if a user closes the app midway through an upload? 4. Is the partially uploaded portion of a chunk stored if the upload is interrupted during that chunk? 5. When is the file created in the bucket - when all the chunks are uploaded? Solution: 1. No, the SDKs do not support resuming an upload using the `Function(Upload
Drake
27 Nov, 2023, 04:16

Incomplete files are not deleted.

Theoretically, it's possible to finish the upload, but the SDK doesn't support that

Vedsaga
27 Nov, 2023, 04:19

I mean, we can implement the work around right? Like if we know the File-id and chunk no then possible, if we break the Chunk and sent that way?

Vedsaga
27 Nov, 2023, 04:19

but, the main issue is,

for how does Chunk files is generally stored in the appwrite? If we never uploaded the remaing Chunks let's say 11 uploaded and 9 pending out of 20, so what happen already uploaded 11 chunks, when does those get deleted?

Vedsaga
27 Nov, 2023, 04:21
TypeScript
class UploadProgress {
  /// ID of the file.
  final String $id;

  /// Progress percentage.
  final double progress;

  /// Size uploaded in bytes.
  final int sizeUploaded;

  /// Total number of chunks.
  final int chunksTotal;

  /// Number of chunks uploaded.
  final int chunksUploaded;
}

using the method, Function(UploadProgress)? onProgress, was thinking to save the every successful upload state to local storage in case Upload pauses.. and so later when app open again or internet back again can resume from smae plae...

Vedsaga
27 Nov, 2023, 04:32

mm, I mean if we send the parital uploaded what is general time-line to reattempt the chuck upload ( is it 1hr, 1 day?) btw, in flutter sdk we do that too no utilize the? Function(UploadProgress)? onProgress method to make logic around it?

Drake
27 Nov, 2023, 04:34

There is no time restriction.

Yes, chunked upload is the same in all SDKs.

No, you can't use on progress. Like I said, the SDKs dont support resuming an upload

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