adilson
adilson
CDCloudflare Developers
Created by adilson on 3/6/2025 in #workers-help
R2 Presigned URL : No upload limit ???!!!
Hey everyone, I'm using presigned URLs to allow users to upload files directly to my R2 bucket, and I noticed that AWS S3 allows setting a content-length-range condition to restrict file size. However, I couldn't find any way to enforce a max file size limit in R2's presigned URLs. Does this mean that anyone with the URL could upload huge files (even terabytes) to my bucket????!!! If so, what's the best way to prevent this? Any official way to enforce size limits at the R2 level? Thanks!
3 replies
CDCloudflare Developers
Created by adilson on 3/2/2025 in #workers-help
Worker and Google Ai FileManager Problem
Hi everyone! I'm trying to use the File API with Gemini in a Cloudflare Worker environment, but I'm running into an issue. According to the documentation, we can use the File API to handle files up to 2GB (instead of the 20MB limit with inline data). However, the GoogleAIFileManager.uploadFile() method seems to only accept a file path string and uses fs.readFileSync internally, which isn't available in Cloudflare Workers. Is there any way to use the File API with an ArrayBuffer or a URL directly? My use case is: 1. User uploads file to our R2 storage 2. I get the file as ArrayBuffer in our Worker 3. I want to send this to Gemini for analysis without the 20MB limit Currently, im forced to use the inline data approach with the 20MB limit since we can't use fs in Workers. Any suggestions for handling larger files in serverless environments?
2 replies
CDCloudflare Developers
Created by adilson on 11/17/2024 in #general-help
Tracking Clicks on Links with Cloudflare: Wich service do you recommend?
Hello! I'm building an app and want to track clicks on links without managing my own database. I already use Cloudflare for my app. What's the best way to handle this: Zaraz? Workers? An other Cloudflare service? Any insights or examples on which service fits better? thank you!
5 replies