Client uploads directly to S3 using the pre-signed URL, then calls:
(ReducerContext ctx, string filename, string s3Key)
| 319 | |
| 320 | // Client uploads directly to S3 using the pre-signed URL, then calls: |
| 321 | [SpacetimeDB.Reducer] |
| 322 | public static void ConfirmUpload(ReducerContext ctx, string filename, string s3Key) |
| 323 | { |
| 324 | ctx.Db.Document.Insert(new Document |
| 325 | { |
| 326 | Id = 0, |
| 327 | OwnerId = ctx.Sender, |
| 328 | Filename = filename, |
| 329 | S3Key = s3Key, |
| 330 | UploadedAt = ctx.Timestamp, |
| 331 | }); |
| 332 | } |
| 333 | |
| 334 | private static string GeneratePresignedUrl(string s3Key, string contentType) |
| 335 | { |