【发布时间】:2015-04-03 10:29:14
【问题描述】:
我正在尝试上传一个文件(在本例中约为 30kb)。我在接收端使用 bash CGI。到目前为止,我只想查看文件的内容。
接收端:
#!/bin/bash
echo "Content-Type: text/plain"
echo
read FILE
echo "$FILE"
发件人表单:
<form class="fileup_form" method="post" action="dds_fileup.cgi" enctype="multipart/form-data">
<input type="submit" />
<input type="file" name="file" />
</form>
目前我得到这个输出:
-----------------------------11054464466732224131260756282
这绝对不是完整的 30kb。
为什么我看不到 POST 文件的全部内容?
【问题讨论】:
-
默认只读“读取”到第一个新行。示例见:git.busybox.net/busybox/tree/networking/httpd_post_upload.txt
标签: html bash post file-upload cgi