node.js - NodeJS File Upload to Amazon S3 Store Mapping to Database -


im looking @ knox s3 library. in web app, users allowed upload files. im thinking of using amazon s3.

in knox, how map file uploaded user? let want know files user uploaded. stored in mongodb.

just idea.

to figure out data uploaded specific user, have 2 options:

  1. use external data store (mongodb or other database) , record relation between uploaded object on s3 (it's key) , user. data recording done app logic when new object uploaded s3.

  2. upload data on s3 under common prefix (e.g. files uploaded user placed in /<user-id>/file.ext) , list request on bucket find keys under prefix.

usually first option works best, if need record multiple relations between s3 objects , other entities.

these scenarios not specific using knox s3 client. apply independent of programming language or s3 library.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -