Skip to content

Commit d731cf9

Browse files
Merge branch 'tdesmond-user-generated-content-ref-arch' of https://github.com/thomas-desmond/cloudflare-docs into tdesmond-user-generated-content-ref-arch
2 parents a535947 + fa78eba commit d731cf9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/docs/reference-architecture/diagrams/storage/storing-user-generated-content.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ And because R2 is natively integrated with Cloudflare's global network, files st
3737
**How it Works**
3838

3939
1. **User initiates upload from the frontend:** The app collects file details (e.g. size, name) and calls a backend API (a Cloudflare Worker) to begin the upload process.
40-
2. **Worker authenticates the user and validates the request:** The Worker confirms that the user is logged in, has upload permissions, and that the file is within acceptable limits (e.g. 10MB max, allowed MIME types).
41-
3. **Worker returns a signed PUT URL to R2:** A signed URL allows the frontend to upload directly to R2 for a limited time, under a specific key or namespace. No need for the Worker to handle large files directly.
40+
2. **Worker authenticates the user and validates the request:** The Worker confirms that the user is logged in, has upload permissions, and that the file is within acceptable limits (for example, 10MB max, allowed MIME types).
41+
3. **Worker returns a signed PUT URL to R2:** A signed URL allows the frontend to upload directly to R2 for a limited time, under a specific key or namespace. There is no need for the Worker to handle large files directly.
4242
4. **Frontend uploads the file directly to R2:** The file is streamed directly from the client to R2.
4343
5. **(Optional) Trigger post-upload workflows:** R2 offers [event notifications](/r2/buckets/event-notifications/) to send messages to a queue when data in your R2 bucket changes, like a new upload. Example post-processing:
4444
- Scan, moderate, or transform the file.
45-
- Write metadata (e.g. `user_id`, `file_path`, `timestamp`) to [D1](/d1/), Cloudflare's serverless SQL database.
45+
- Write metadata (for example, `user_id`, `file_path`, `timestamp`) to [D1](/d1/), Cloudflare's serverless SQL database.
4646
- Notify the user or update a dashboard/UI.
4747

4848
For more information on uploading data directly from the client to R2, refer to the documentation on [presigned URLs](/r2/api/s3/presigned-urls/).
@@ -57,7 +57,7 @@ This architecture employs [Workers AI](/workers-ai/) to perform inference at the
5757

5858
**How it Works**
5959

60-
1. **User initiates content generation:** The frontend sends a request to a Cloudflare Worker to create content using an AI model (e.g. "Create a thumbnail image for this product").
60+
1. **User initiates content generation:** The frontend sends a request to a Cloudflare Worker to create content using an AI model (for example, "Create a thumbnail image for this product").
6161
2. **Worker invokes Workers AI:** The Worker passes the user input to a model deployed on Workers AI.
6262
3. **Generated output is returned to the Worker:** The response could be plain text, a Base64 image, a binary buffer, or other structured data—depending on the model type.
6363
4. **Worker uploads the output to R2 directly:** No signed URL or client upload is needed. The Worker performs a secure, authenticated `PUT` request to store the output in a designated bucket.

0 commit comments

Comments
 (0)