nginx上傳檔案不使用後台程式碼
淡淡烟草味
淡淡烟草味 2017-05-16 17:29:46
0
2
586

就是不使用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直接指定一個路徑存起來就行 不再做後台處理

淡淡烟草味
淡淡烟草味

全部回覆(2)
小葫芦

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

Ty80

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

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!