質問

だから、私はクライアントがパスワード保護ファイルの解決策を要求しています。彼は基本的にOpenDocmanと同様の解決策を持っています。しかし、彼は基本的にパスワードをファイル自体に保護しない他のクライアントから何かを私に示しました。それで彼はファイルをアップロードし、そのファイルにパスワードを入力し、そのファイルに直接リンクを送信してから、ユーザーがパスワードを求めてプロンプトを表示してからクライアントが公開され、ファイルが解放されます。この正確な要件を実行できる解決策を知っている人は誰でも?

役に立ちましたか?

解決

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.

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top