Relatude Help

Very large files

Where the file store supports it, files too large for one request go up in chunks: start the upload, append the chunks, finalize.

if (db.FileStoreSupportsMultipartUploads(venue.Photo)) {
    var uploadId = await db.InitiateMultipartUploadAsync(venue.Photo, "walkthrough.mp4");
    while (/* more data */) {
        await db.AppendMultipartUploadAsync(uploadId, buffer, length);   // strictly in order
    }
    FileValue value = await db.FinalizeMultipartUploadAsync(uploadId);
    // …or, on failure: await db.CancelMultipartUploadAsync(uploadId);
}
  • Append the chunks in order, one at a time. For speed, upload several files at once instead.
  • An upload lives in memory on that store. After 10 minutes without activity it expires and the partial file is deleted.
  • The node changes only when you finalize, so a cancelled or expired upload leaves it as it was.