Heim  >  Fragen und Antworten  >  Hauptteil

Nginx lädt Dateien hoch, ohne Hintergrundcode zu verwenden

Übertragen Sie die Datei einfach in das angegebene Verzeichnis, ohne PHP Python und andere Hintergrundverarbeitung zu verwenden

<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>

Verwenden Sie einfach diese einfache Seite zum Hochladen, und dann kann Nginx direkt einen Pfad zum Speichern angeben, ohne dass eine Hintergrundverarbeitung erforderlich ist

淡淡烟草味淡淡烟草味2712 Tage vor597

Antworte allen(2)Ich werde antworten

  • 高洛峰

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

    nginx本身应该是不支持的,而且nginx原生不支持cgi,所以看样子,要么你得写个nginx的插件来做这件事情,要么就还是上fastcgi吧。这里有个简单的guide,让你把nginx配置成“支持cgi”:http://wiki.nginx.org/SimpleCGI

    Antwort
    0
  • PHP中文网

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

    我觉得不能吧,因为你得完成文件流的传送,你这个单一个HTML如何实现?

    Antwort
    0
  • StornierenAntwort