Search
Setup for Free
TTC
Theo's Typesafe Cult
•
3y ago
l
S3 with TRPC
can somebody give me repo or tutorial how to use s3 with trpc
?
(never used aws before
)
Theo's Typesafe Cult
Join
26,230
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
C
chip
•
4/13/23, 12:17 PM
If you
're going to upload files from the client
, you can
't use tRPC
, unless you send them as base64
.
Another solution is just to create a api route and make a POST req to it with FormData or smth
G
Glorrin
•
4/13/23, 12:23 PM
make a request to generate a put signed urls from s3
use this url to put your file on s3 from the client
send a final request to update database
(in most cases you want to keep track of this file
)
W
whatplan
•
4/13/23, 4:49 PM
https://blog.nickramkissoon.com/posts/t3-s3-presigned-urls
Developer Blog | Nicholas Ramkissoon
Integrate S3 Presigned URL Operations Into Your create-t3-app Project
Integrate S3 presigned URLs into your create
-t3
-app project to allow user file uploads directly to your S3 bucket
.
W
whatplan
https://blog.nickramkissoon.com/posts/t3-s3-presigned-urls
C
chip
•
4/13/23, 9:12 PM
Wouldn
't this let any potential malicious client grab the presigned url and make a PUT req to it
?
C
chip
•
4/13/23, 9:14 PM
Also keeping these types of things on the client makes it harder to moderate what type of images that are uploaded
, unless whatever service you
're using actually has some built
-in moderation you can use
.
L
l
OP
•
4/13/23, 10:13 PM
Thanks a lot
C
chip
Wouldn't this let any potential malicious client grab the presigned url and make...
L
l
OP
•
4/13/23, 10:30 PM
I guess in CORS policy on aws s3 bucket I should just put my domain and I should not have worries
?
C
chip
•
4/13/23, 10:43 PM
A step in the right direction at least
C
chip
A step in the right direction at least
L
l
OP
•
4/13/23, 11:55 PM
Anyway thanks a lot
, Ill change those things
C
chip
Wouldn't this let any potential malicious client grab the presigned url and make...
J
jingleberry
•
4/15/23, 12:58 AM
You set the expiration to by small enough so that there
’s just enough time to initiate the upload on the client
J
jingleberry
•
4/15/23, 12:59 AM
Plus other security headers
/policies
D
danmrkw
•
4/16/23, 1:35 PM
I have done this in my project librepoll
https://github.com/danielmarkow/librepoll/blob/main/src/server/api/routers/formDataRouter.ts
by creating an user on AWS with restricted rights
. I use this user with the AWS sdk to create the presigned URLs
. The bucket itself remains private
.
GitHub
librepoll/formDataRouter.ts at main · danielmarkow/librepoll
easy polls for everybody
. Contribute to danielmarkow
/librepoll development by creating an account on GitHub
.
L
l
I guess in CORS policy on aws s3 bucket I should just put my domain and I should...
Y
Yoers
•
4/16/23, 2:04 PM
CORS is only clientside protection
, any server can just spoof the host header
, meaning any malicious actor could still abuse
.
Similar Threads
Help with s3
TTC
Theo's Typesafe Cult / questions
3y ago
SSG with tRPC
TTC
Theo's Typesafe Cult / questions
16mo ago
tRPC with stripe
TTC
Theo's Typesafe Cult / questions
3y ago
Pusher with trpc
TTC
Theo's Typesafe Cult / questions
3y ago