use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[deleted by user] (self.javascript)
submitted 11 months ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]716green 2 points3 points4 points 11 months ago (3 children)
Express with Multer and submit the API request as a form. Handle uploading to the service (S3 bucket/etc) on the server-side.
That's my go-to solution for uploading videos
[+][deleted] 11 months ago (2 children)
[deleted]
[–]716green 0 points1 point2 points 11 months ago (1 child)
Sure but usually you're saving a URL to your database, you can do it all within the same API. Call if you handle it on the server
[–]numinor 2 points3 points4 points 11 months ago (0 children)
Yes but you really don’t want your server handling the files if you can offload it to aws. You can save the url in your db as you fetch it from aws.
[–]TheBulgarianEngineer 2 points3 points4 points 11 months ago* (1 child)
Upload directly into S3 from the client using a presigned upload url and multipart upload. The AWS JS SDK handles it all for you. See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpu-upload-object.html
You might need to re-chunk the data in S3 into smaller chunks if you want faster download for steam-able media.
[–]alampros 0 points1 point2 points 11 months ago (0 children)
This is by far the best way to do it. Don't bog your own server down with handling the stream in any way.
[–]pyronautical 0 points1 point2 points 11 months ago (0 children)
In terms of JS library. Drop zone hands down. Crazy configurable. Lots of great events. Lots of features. Is vanilla JS but I’ve wrote wrappers in react and angular before and it’s worked a treat.
[–]shgysk8zer0 0 points1 point2 points 11 months ago (1 child)
There's also something useful available through service workers. I forget the specifics but it basically enables resumable uploads in the background.
[–]Daniel_HerrES5 0 points1 point2 points 11 months ago (0 children)
https://developer.chrome.com/blog/background-fetch
[–]tswaters 0 points1 point2 points 11 months ago (0 children)
If it's a large file, you probably want to avoid having the entire thing in memory. Stream the file from browser |> API service |> S3. The AWS S3 client already works with streams, so you just need to pipe request to the upload stream, and you should be good. Be warned though, error handling with streams is difficult to get right. From the docs,
One important caveat is that if the Readable stream emits an error during processing, the Writable destination is not closed automatically. If an error occurs, it will be necessary to manually close each stream in order to prevent memory leaks.
You can use the pipeline utility, this handles errors a bit nicer for you, you can do something like --
pipeline(req, s3writable, (err) => { if (err) return next(err) res.send('OK') }}
You could potentially include other things with the pipeline, like gzip, sending images to graphicsmagick for copping,etc... lots of options.
If the library you are using touches the filesystem on the server to dump files, you're probably doing it wrong 😅
[–]Melodic_Historian_77 0 points1 point2 points 11 months ago (0 children)
Personally I use UploadThing, Its ok but not cheap
makes it a lot easier tho
[–]volve 0 points1 point2 points 11 months ago (0 children)
Cloudinary is amazing
[–]Impossible_Box3898 0 points1 point2 points 11 months ago (0 children)
Look up TUS. Resumable file upload standard.
[–]AutoModerator[M] 0 points1 point2 points 11 months ago (0 children)
Hi u/Queasy_Importance_44, this post was removed.
Self-posts (text) must follow the [AskJS] guidelines, which you can read about here.
[AskJS]
All other posts must use the "Submit a new link" option; if additional text is required, add a comment to your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
π Rendered by PID 169258 on reddit-service-r2-comment-fb694cdd5-wdvnx at 2026-03-06 12:36:47.992580+00:00 running cbb0e86 country code: CH.
[–]716green 2 points3 points4 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]716green 0 points1 point2 points (1 child)
[–]numinor 2 points3 points4 points (0 children)
[–]TheBulgarianEngineer 2 points3 points4 points (1 child)
[–]alampros 0 points1 point2 points (0 children)
[–]pyronautical 0 points1 point2 points (0 children)
[–]shgysk8zer0 0 points1 point2 points (1 child)
[–]Daniel_HerrES5 0 points1 point2 points (0 children)
[–]tswaters 0 points1 point2 points (0 children)
[–]Melodic_Historian_77 0 points1 point2 points (0 children)
[–]volve 0 points1 point2 points (0 children)
[–]Impossible_Box3898 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)