Write your answer…

7 answers

Another idea, which may require too much effort on the part of the user, is to show a unique token or url for each uploaded piece of content. The user can choose to store this and use it to edit the content.

Advantages: it's more anonymous, since there are no cookies to track users, and you can't even track which pieces of content are uploaded by the same user. The tokens also persist after clearing cookies or even reinstalling the PC.

Disadvantages: it's clearly quite some effort for the user to keep track of all the tokens.

P.s. it sounds like may use your service to upload nsfw or copyrighted content.... But maybe that's the point.

Spot On2
Show all replies

Given the lengths mentioned in other answers, it might be worth adding that the token should be longer than 4 characters. It can just be 32 because people will just copy-paste or bookmark it anyway, nobody is going to remember even 6 random characters per upload, why make it short?

Reply to this…

Hashnode is building a friendly and inclusive dev community. Come jump on the bandwagon!

  • 💬 A beginner friendly place

  • 🧠 Stay in the loop and grow your knowledge

  • 🍕 >500K developers share programming wisdom here

  • ❤️ Support the growing dev community!

Register ( 500k+ developers strong 👊)

Even though they're anonymous users, generate a unique id for each user from the client side itself and save it in cookies with a long expiry.

Whenever someone uploads a file save that unique id along with the file. Now you can allow users to edit the file if its owner is the same as in the cookies.

You can use uuidv4 or something for unique ids

Spot On1
Show all replies

"who uploaded which content" that is what the author of this question wants!

Reply to this…

I'd at least make them type in an e-mail address if they want to edit. Generate an authorization code for editing, and send it to them that way. OR just display the edit authorization code when they create the file, they lose that code, well... that's their fault.

Any other method -- sessions, cookies, localstorage -- isn't portable or permanent.

Show all replies

Gijo Varghese Basically what Mark said. He calls it a token... people also call them hashes, passwords, whatever. A unique randomly generated sequence of characters that you use to authorize the access.He and I said the same thing, we just used different terminology.

You could either have them enter a e-mail to have it sent to them, or simply display it on screen, or even put up two different URL's -- one for showing it, one for editing it.

I rarely suggest using JavaScript for "Add bookmark" methods, but this is a case where the technique would be a nice enhancement. Show the edit token as a URI with a button next to it for bookmarking.

You could even once it is uploaded go straight to the edit page for it, giving them the chance to bookmark the edit page URI.

Reply to this…

give them a random token to remember ( not long 4 digit ) and then this will there identity . Store this in cookie and give them the editing ability using this token

Show all replies

Actually its not digit .... it should be characters with numbers. Sorry my mistake

Reply to this…

Use a random code in the url (8 letters/digits should be enough) so that they can access their space on both desktop and mobile devices. It's kind of like mailinator.com where you can create fake email addresses. The only thing is that if you use an existing name, you can read the content of that user. Maybe that's ok for your use case?

Load more responses