我在http://fastcgi.com/中使用C++应用程序中的库作为后端,使用nginx web服务器作为前端.
成功发布HTML表单中的文件,可以在nginx服务器端查看临时文件.但我无法弄清楚如何使用fastcgi_stdio访问多部分POST请求的主体.这是我的HTML表单.
<html>
<head>
<title>Test Server</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
</head>
<body>
<form id="upload-form" method="post" target="upload_target" enctype="multipart/form-data" action="/upload">
<input name="file" id="file" size="27" type="file" /><br />
<input type="submit" name="action" value="Upload" /><br />
<iframe id="upload_target" name="upload_target" src="" style="width:100%;height:100px;border:0px solid #fff;"></iframe>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的nginx conf文件:
location /upload {
# Pass altered request body to this location
upload_pass @test;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should …Run Code Online (Sandbox Code Playgroud)