首頁  >  問答  >  主體

nginx上傳檔案不使用後台程式碼

就是不使用PHP Python 等後台處理 只把檔案傳到指定目錄裡

<html>
<head>
<title>Test upload</title>
</head>
<body>
<h2>Select files to upload</h2>
<form name="upload" method="POST" enctype="multipart/form-data" action="/upload">
<input type="file" name="file1"><br>
<input type="file" name="file2"><br>
<input type="file" name="file3"><br>
<input type="file" name="file4"><br>
<input type="file" name="file5"><br>
<input type="file" name="file6"><br>
<input type="submit" name="submit" value="Upload">
<input type="hidden" name="test" value="value">
</form>
</body>
</html>

就是用這個一個簡單的頁面上傳 然後nginx直接指定一個路徑存起來就行 不再做後台處理

淡淡烟草味淡淡烟草味2712 天前589

全部回覆(2)我來回復

  • 高洛峰

    高洛峰2017-05-16 17:31:46

    nginx本身應該是不支援的,而且nginx原生不支援cgi,所以看樣子,要嘛你得寫個nginx的插件來做這件事情,要嘛就還是上fastcgi吧。這裡有個簡單的guide,讓你把nginx配置成「支援cgi」:http://wiki.nginx.org/SimpleCGI

    回覆
    0
  • PHP中文网

    PHP中文网2017-05-16 17:31:46

    我覺得不能吧,因為你得完成文件流的傳送,你這個單一個HTML如何實現?

    回覆
    0
  • 取消回覆