Is TUS protocol supported by Railway?
Greetings!
I am building a NodeJS (express) server that you upload files to, which are then uploaded to an AWS S3 bucket.
In order to handle large file uploads, the TUS protocol is used.
The files are uploaded from an Android app.
When the server is running on my local machine, everything seems to be working smoothly, but when I tested it on Railway, I seem to be getting some 301 (moved permanently) status codes.
Any clues as to what I could try tinkering with on the Railway config side?
(I could provide some code if you think that would help)
Solution:Jump to solution
Since you're getting a 301, are you by chance using a HTTP call instead of HTTPS?
10 Replies
Project ID:
N/A
N/A
Looks like TUS is just a post + patch + put so I can't see a reason why it wouldn't work. π€
Indeed. In theory there should not be much to it, so I am going over my configuration to see if I screwed anything up...
Solution
Since you're getting a 301, are you by chance using a HTTP call instead of HTTPS?
theres also a 5 minute limit for uploads to the platform, so you might be way better off returning a signed aws s3 URL to the user to upload to
Oh! You seem to have lead me to find the culprit. When I make a request using https, the response header seems to be returning an http location (where all subsequent PATCH calls must be made), so it seems to be the source of my issues. Will tinker a bit around there.
@Brody I was not aware of this 5 minute limit. I will have a look at how I could implement this signed URL thing so that users may upload files to my bucket. Thank you!
the aws SDK has a function to generate a signed URL, it's super simple, and if your app doesn't actually need to modify the incoming files, it's what you absolutely should be doing
Much obliged. Will take a look at the docs. Thanks to both of you.
no problem! π