jeudi 14 juillet 2016

How can I us JS to create a non-guessable random filename in a public directory?

I am creating a JS/Node program that lets users at a public kiosk save an image to a public AWS S3 bucket. They then enter their own email address and we send them an email with a link to that image so that they can retrieve it once they get home.

The entire S3 bucket needs to be public so that users can easily view their own individual image. However, I want to make it unlikely that visitors could guess another image's filename, viewing another person's image. This is more of a light privacy concern than a security concern.

How can I use JS to randomly generate the alphanumeric filename? How long should the filename be?




Aucun commentaire:

Enregistrer un commentaire