正面がシティレラ城の場所を午後5時から確保しました。
殆ど雑音なしでお楽しみください。
【HTMLファイル】<html><head><title>ファイルアップロード</title></head><body>【gawk プログラム】
<!-- fromの属性に enctype="multipart/form-data" を付けるのを忘れずに! //--><form method="post" action="/cgi-bin/gawk.cgi" enctype="multipart/form-data"><input type=text name="path"><input type="file" name="file1" size="60" /><input type="file" name="file2" size="60" /><input type="submit" name="submit" value="送信" /></form></body></html>
【受け取る gawk】#! /usr/bin/gawk -fBEGIN{print "Content-Type: text/plain"print ""print "This is test"print 1,ENVIRON["AUTH_TYPE"]print 2,ENVIRON["CONTENT_LENGTH"]print 3,ENVIRON["CONTENT_TYPE"]print 4,ENVIRON["GATEWAY_INTERFACE"]print 5,ENVIRON["PATH_INFO"]print 6,ENVIRON["PATH_TRANSLATED"]print 7,ENVIRON["QUERY_STRING"]print 8,ENVIRON["REMOTE_ADDR"]print 9,ENVIRON["REMOTE_HOST"]print 10,ENVIRON["REMOTE_IDENT"]print 11,ENVIRON["REMOTE_USER"]print 12,ENVIRON["REQUEST_METHOD"]print 13,ENVIRON["SCRIPT_NAME"]print 14,ENVIRON["SERVER_NAME"]print 15,ENVIRON["SERVER_PORT"]print 16,ENVIRON["SERVER_PROTOCOL"]print 17,ENVIRON["SERVER_SOFTWARE"]system("rm /var/www/win/up/myfile")}{print $0 >> "/var/www/win/up/myfile"}
【関連する環境変数】
Content Type の環境変数
multipart/form-data; boundary=----WebKitFormBoundaryMU4Bxx8HoqSOyTQG
実際のデータ
【標準出力か取得できる】------WebKitFormBoundaryMU4Bxx8HoqSOyTQGContent-Disposition: form-data; name="path"myPath------WebKitFormBoundaryMU4Bxx8HoqSOyTQGContent-Disposition: form-data; name="file1"; filename="README"Content-Type: application/octet-stream<テキストデータ;省略>------WebKitFormBoundaryMU4Bxx8HoqSOyTQGContent-Disposition: form-data; name="file2"; filename="google日本語.png"Content-Type: image/png?PNG<PNG画像データ;省略>------WebKitFormBoundaryMU4Bxx8HoqSOyTQGContent-Disposition: form-data; name="submit"送信------WebKitFormBoundaryMU4Bxx8HoqSOyTQG--