Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーが自分のマシンにコンテンツを保存できるようにしたいWebページがあります。Web ページは、prototype.js で AJAX を既に使用しています。サーバー側のコードは PHP で書かれています。ユーザーがファイルを指定してデータを保存できるように、ファイル ダイアログを作成するにはどうすればよいですか? サーバーは Linux を実行しています。
HTML:
<input type="file" name="file" id="file">
PHP:
header('Content-type: text/plain'); header('Content-disposition:attachment; filename="yourfile.txt"');