All Questions



What is the best way to upload an mp3 file from the browser? [SOLVED]

I need to allow podsqueeze users to upload their mp3 files so that I can transcribe them. Google functions have a limit of 10Mb upload. What are my options? Maybe using google buckets?

author Tiago Ferreira

Reply
8 Answers

Dropbox? Hetzner storage?

writen by Benedikt

Hetzner storage could be a good option. is quite cheap right? Why not a google service?

writen by Tiago Ferreira

I use s3 all the time for that.

You need to generate a ‘presigned url’ (s3 terminology) that you give to the browser and then the browser uploads the file there with a PUT request.

I’m almost sure Google has a similar way of doing that.

The key thing is to not use any Lambdas/Google functions but upload it directly from the browser to the store.

writen by Kirill Rogovoy

is that safe Kirill Rogovoy?

writen by Tiago Ferreira

Depends on what you mean, but generally yes.

The (unique) upload link allows the user to only upload one file to a predetermined path, and it expires in a given timeframe (e.g. 1 minute)

writen by Kirill Rogovoy

So the full path is

  1. browser calls your api to get the link
  2. browser uploads the file
  3. one of a. browser calls your api to signal that uploading is done (I do this) b. you setup a cloud function that’s called when there’s a new file uploaded

writen by Kirill Rogovoy

That’s a good solution. That way you could also drop in another storage provider without changing much

writen by Benedikt

Great solution! Thank you Kirill Rogovoy

writen by Tiago Ferreira

Do you want to ask a question?


Related Questions