Procedures
getUploadUrl
Type: MutationAuthentication: Public (no authentication required) Generate a presigned URL for uploading a file to R2 storage.
Name of the file to upload
MIME type of the file (e.g., “application/pdf”, “image/png”)
Presigned URL for uploading the file
HTTP method to use (always “PUT”)
- The presigned URL expires in 1 hour (3600 seconds)
- You must upload the file using the PUT method
- The Content-Type header must match the contentType specified
getDownloadUrl
Type: QueryAuthentication: Public (no authentication required) Generate a presigned URL for downloading a file from R2 storage.
File key/path in R2 storage
Presigned URL for downloading the file
- The presigned URL expires in 1 hour (3600 seconds)
- The key should match the filename used during upload
- Use this for secure, temporary access to files
File Storage
The DeltaHacks Portal uses Cloudflare R2 for object storage. Files are stored securely and accessed via presigned URLs that expire after 1 hour.Upload Flow
- Call
getUploadUrlwith filename and content type - Receive a presigned URL
- Upload the file directly to R2 using PUT request
- Store the filename/key for later retrieval
Download Flow
- Call
getDownloadUrlwith the file key - Receive a presigned URL
- Use the URL to fetch or display the file
- URL expires after 1 hour
Common Content Types
- PDF:
application/pdf - PNG Image:
image/png - JPEG Image:
image/jpeg - Word Document:
application/vnd.openxmlformats-officedocument.wordprocessingml.document - Plain Text:
text/plain