如果我设置一个带有以下表单的HTML页面:
我可以上传文件到upload_file.php,并使用PHP脚本处理它。
为了测试目的,我需要通过PuTTY会话使用原始HTTP进行相同的操作。
我可以通过常规POST方式(只发送文本数据)来执行此操作:
<html>
<body>
<form action="upload_file.php"
method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
我可以上传文件到upload_file.php,并使用PHP脚本处理它。
为了测试目的,我需要通过PuTTY会话使用原始HTTP进行相同的操作。
我可以通过常规POST方式(只发送文本数据)来执行此操作:
POST /test_post.php HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 11
name=myname
我怎样才能以这种方式发送文件?