语法: file_name = ngx.req.get_body_file()
环境: rewrite_by_lua*, access_by_lua*, content_by_lua*
获取存储请求体数据的临时文件名。如果请求体尚未被读取或已被读取到内存中,此函数将返回 nil
。
本函数返回的文件是只读的,通常情况下会被 Nginx 的内存池清理机制清理。不应该手工修改、更名或删除这个文件。
如果请求体尚未被读取,请先调用 ngx.req.read_body (或打开 lua_need_request_body 选项强制本模块读取请求体。此方法不推荐)。
如果请求体已经被读入内存,请使用 ngx.req.get_body_data 函数代替。
如需要强制在临时文件中保存请求体,请打开 client_body_in_file_only 选项。
这个函数在 `v0.3.1rc17`` 版本中首次引入。
更多用法请参考 ngx.req.get_body_data。
English Source
syntax: file_name = ngx.req.get_body_file()
context: rewrite_by_lua*, access_by_lua*, content_by_lua*
Retrieves the file name for the in-file request body data. Returns nil
if the request body has not been read or has been read into memory.
The returned file is read only and is usually cleaned up by Nginx's memory pool. It should not be manually modified, renamed, or removed in Lua code.
If the request body has not been read yet, call ngx.req.read_body first (or turned on lua_need_request_body to force this module to read the request body. This is not recommended however).
If the request body has been read into memory, try calling the ngx.req.get_body_data function instead.
To force in-file request bodies, try turning on client_body_in_file_only.
This function was first introduced in the v0.3.1rc17
release.
See also ngx.req.get_body_data.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。