0

My concept here is, I will upload files on my website via FTP e.g. www.mywebsite.com/dropbox/

And then I will share that URL with others, they can view the folder contents only if they can enter correct password.

Can this be done with JavaScript alone or will require another framework !

I know basics of JS and NODEjs.

Im looking for something like this, but no other fancy stuff http://www.filefactory.com/f/6ba85c1e889f59d4

STEEL
  • 8,955
  • 9
  • 67
  • 89

1 Answers1

0

You will have to protect the password, which you can't do via javascript. JS is downloaded to the client and is visible to anyone. You really need some kind of server based logic to accept user input and then validate their password against yours..In ASP.Net you could post it to a webmethod and compare it to either a hard coded value in the code or via a value in a database table (stored on the server). If the user's password and the hard coded value are a match then return True to enable the content.

Rob
  • 1,226
  • 3
  • 23
  • 41
  • I'm a Jquery guy so not familiar with Nodejs but any script variation resides on the client and is visible to anyone either by viewing the source or via FireBug (in FireFox browser). You are going to need some kind of server based function (php, asp.net, etc) to validate the password. – Rob Nov 23 '12 at 19:31
  • anyway can we encrypt the password with javascript ? – STEEL Nov 24 '12 at 04:58
  • No because your encrypt/decrypt would have to reside on the client machine. – Rob Nov 25 '12 at 20:31