文章15:Nginx upload 模块(一)
来源:互联网 发布:知乎 刘志军高铁贡献 编辑:程序博客网 时间:2024/05/29 12:38
Upload Module
A module for nginx web server for handling file uploads using multipart/form-data encoding (RFC 1867) and resumable uploads according to this protocol.
upload模块是nginx网络服务器的一个模块,该模块使用multipart/form-data 编码方式上传文件,并且通过该协议可以重新获取上传文件。
Description
The module parses request body storing all files being uploaded to a directory specified by upload_store directive. The files are then being stripped from body and altered request is then passed to a location specified by upload_pass directive, thus allowing arbitrary handling of uploaded files. Each of file fields are being replaced by a set of fields specified by upload_set_form_field directive. The content of each uploaded file then could be read from a file specified by $upload_tmp_path variable or the file could be simply moved to ultimate destination. Removal of output files is controlled by directive upload_cleanup. If a request has a method other than POST, the module returns error 405 (Method not allowed). Requests with such methods could be processed in alternative location via error_page directive.
概述:
upload模块解析存储所有文件的请求体,所有文件被上传到upload_store指定的目录中。然后文件从body中被剥离,接着被传送到upload_pass指定的location中,因此允许任意处理上传文件。每个文件的字段被一组由upload_set_form_field指定的字段取代。之后,每个上传文件的内容可以从变量$upload_tmp_path指定的文件中读取,或者文件直接简单的保存到最终目的地。输出文件的删除由指令upload_cleanup指定。如果一个请求不是POST请求,那么upload模块会返回405错误。其他方法的请求处理可以通过指令error_page进行处理。
译者注:通过我的查证,可以发现upload_pass @xxx,即传到location @xxx中的ngx_request_t r中的请求体不包含文件信息,即原文中The files are then being stripped from body的含义所在。
指令部分就不一一进行翻译。对于upload模块的配置请见下篇文章。
- 文章15:Nginx upload 模块(一)
- Nginx的Upload上传模块
- nginx upload module/process模块的安装
- Nginx Upload Module 上传模块测试例子
- nginx-upload-module模块实现文件断点续传
- nginx-upload-module模块实现文件断点续传
- Nginx初步-2: 添加nginx-upload-module模块
- nginx-upload-module文件上传模块问题处理
- nginx模块的认识(一)
- NGINX模块(一)
- Nginx event核心模块之epoll模块详解(一)
- centerOS 6.5安装nginx并添加nginx-upload-module断点续传模块
- 文章8:Nginx模块开发概述
- nginx事件模块分析(一)
- nginx-upload-progress
- nginx 配置upload服务
- nginx负载均衡策略分析[一](round_robin模块概要)
- nginx学习笔记一(开发自己的http模块)
- SPFile.Properties Property
- xilinx与altera
- 基于ajax的Html5文件上传插件,带进度并支持图片预览
- iframe 自适应高度的问题(jquery控制)
- 如何删除cocos2d-x的模板
- 文章15:Nginx upload 模块(一)
- 我之于我
- Android SurfaceView简介
- Node.js零起点开发(二)-require的用法
- MySql中文乱码错误 mysql error 1366 incorrect string value 不能插入中文字符
- [置顶] android 实现发送彩信方法 (MMS),非调用系统彩信界面
- regulator
- 数据库 视图
- C++ 连接Oracle