You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consturl=s3file.presign({method: "PUT"});// Requires client-side size validation, which is not secure// No S3-level security guarantees
Server Proxy:
// Stream through server to validateapp.post('/upload',(req,res)=>{if(req.headers['content-length']>maxSize){returnres.status(413).send();}// Stream to S3...});
All alternatives either compromise security, performance, or developer experience.
The text was updated successfully, but these errors were encountered:
const upload = s3.presign("my-file", {
method: 'PUT',
expiresIn: 3600,
type: 'application/json',
minFileSize: 1,
maxFileSize: 5 * 1024 * 1024 * 1024
});
and Bun does all the magic in the background.
Not the best idea tbh, I've encountered issues where one S3-compatible provider supports only a small subset of restrictions, some have completely different/nonstandard names, some don't support at all. Probably best to leave to the user
What is the problem this feature would solve?
When implementing browser-based uploads to S3, we need to enforce security policies (file size limits, content types) at the storage level.
Currently, Bun's S3 client supports basic presigned POST but lacks S3's
POST policy
system, forcing developers to:What is the feature you are proposing to solve the problem?
Add support for S3 POST policies in Bun's native S3 client:
This would:
What alternatives have you considered?
All alternatives either compromise security, performance, or developer experience.
The text was updated successfully, but these errors were encountered: