Pergunta

Então, eu tenho um cliente solicitando uma solução para arquivos de proteção de senha.Ele quer basicamente ter uma solução semelhante ao Opendocman.No entanto, ele me mostrou algo de outro cliente que basicamente apenas senha protege o próprio arquivo sem nome de usuário.Assim, ele pode fazer upload de arquivos, colocar uma senha nesse arquivo, enviar links diretamente para esse arquivo e, em seguida, quando os usuários clicarem em um link, eles são solicitados com a senha e, em seguida, os clientes a coloca e o arquivo é liberado.Alguém sabe de uma solução que pode fazer este requisito exato?

Foi útil?

Solução

You can setup a basic validation page so that when a user visits a page they enter the document id (or it's encoded in the link) and you put up a simple form with a password field and a submit button.

If the password matches what is stored in the database for that document id. send that file to the user.

Keep the uploaded files outside the /web directory so you don't have to worry about people hacking the system by guessing filenames.

The files themselves won't have passwords on them, but the only way from the outside to get the file is to have the password.

Outras dicas

If you don't have to have a unique password for every file, you can try apache's mod_auth. You drop a .htaccess & .htpasswd file in the directory you want to protected, and update the users/passwords in the .htpasswd file.

If you want something more dynamic, try mod_auth_mysql, so you have better control from your application.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top