Home  >  Q&A  >  body text

nginx uploads files without using background code

Just transfer the file to the specified directory without using PHP Python and other background processing

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

Just use this to upload a simple page, and then nginx can directly specify a path to save it without any background processing.

淡淡烟草味淡淡烟草味2712 days ago590

reply all(2)I'll reply

  • 高洛峰

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

    nginx itself should not support it, and nginx does not natively support cgi, so it seems that you either have to write an nginx plug-in to do this, or you should use fastcgi. Here is a simple guide to configure nginx to "support cgi": http://wiki.nginx.org/SimpleCGI

    reply
    0
  • PHP中文网

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

    I don’t think so, because you have to complete the file stream transmission. How do you implement this as a single HTML?

    reply
    0
  • Cancelreply