briangreenery / share

An internal web app for sharing files using dropzone.js
The Unlicense
4 stars 5 forks source link

Uploads are now stored into directory of their SHA1, rather than a ra… #17

Closed edgao closed 5 years ago

edgao commented 9 years ago

…ndomly generated 5-character directory. (tmp directory still uses random directory name)

11 Progress on this - now really sure what the best way to shorten URLs is. This commit is mostly meant to be a starting point for that.

edgao commented 9 years ago

Obvious way to handle URL-shortening would be to have a flat file that maps SHA1 to filenames, but that sounds like a terrible idea.

Possible idea: When uploading a file, also create a short-name directory (random 5-characters); inside that directory store the hash of the file?

briangreenery commented 9 years ago

Thanks for doing this, but I'm not sure we should include this change. It makes the share URL a little longer, and I'm not sure it provides much benefit over the current system. It looks like it also computes the SHA1 after the upload is complete, so it will make it take longer.