{"id":13776310,"url":"https://github.com/agentzh/lua-resty-multipart-parser","last_synced_at":"2025-04-14T17:30:59.180Z","repository":{"id":43625321,"uuid":"71672848","full_name":"agentzh/lua-resty-multipart-parser","owner":"agentzh","description":"Simple multipart data parser for OpenResty/Lua","archived":false,"fork":false,"pushed_at":"2016-10-23T00:47:06.000Z","size":4,"stargazers_count":38,"open_issues_count":2,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-02-13T00:46:42.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-23T00:15:56.000Z","updated_at":"2024-02-13T00:46:42.453Z","dependencies_parsed_at":"2022-09-16T07:51:55.233Z","dependency_job_id":null,"html_url":"https://github.com/agentzh/lua-resty-multipart-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentzh%2Flua-resty-multipart-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentzh%2Flua-resty-multipart-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentzh%2Flua-resty-multipart-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentzh%2Flua-resty-multipart-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentzh","download_url":"https://codeload.github.com/agentzh/lua-resty-multipart-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223639403,"owners_count":17177816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:00:22.588Z","updated_at":"2024-11-08T06:03:13.475Z","avatar_url":"https://github.com/agentzh.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"Name\n====\n\nlua-resty-multipart-parser - Simple multipart data parser for OpenResty/Lua\n\nTable of Contents\n=================\n\n* [Name](#name)\n* [Synopsis](#synopsis)\n* [Description](#description)\n* [TODO](#todo)\n* [Community](#community)\n    * [English Mailing List](#english-mailing-list)\n    * [Chinese Mailing List](#chinese-mailing-list)\n* [Bugs and Patches](#bugs-and-patches)\n* [Author](#author)\n* [Copyright and License](#copyright-and-license)\n\nSynopsis\n========\n\n```lua\nlocal parser = require \"resty.multipart.parser\"\n\nngx.req.read_body()\n\nlocal body = ngx.req.get_body_data()\n\nlocal p, err = parser.new(body, ngx.var.http_content_type)\nif not p then\n   ngx.say(\"failed to create parser: \", err)\n   return\nend\n\nwhile true do\n   local part_body, name, mime, filename = p:parse_part()\n   if not part_body then\n      break\n   end\n   ngx.say(\"== part ==\")\n   ngx.say(\"name: [\", name, \"]\")\n   ngx.say(\"file: [\", filename, \"]\")\n   ngx.say(\"mime: [\", mime, \"]\")\n   ngx.say(\"body: [\", part_body, \"]\")\nend\n```\n\nDescription\n===========\n\nThis Lua library provides a simple parser for the multipart data format. Unlike the [lua-resty-upload](https://github.com/openresty/lua-resty-upload) library,\nthis parser does not support streaming processing of file uploads using the multipart format. However, it is more flexible in that it can be used\nto parse buffered request bodies read by the builtin request body reader of the NGINX core.\n\nAnyway, be very careful when using this for large file uploads. Use `lua-resty-upload` instead.\n\nTODO\n====\n\n* Better error reporting.\n\n[Back to TOC](#table-of-contents)\n\nCommunity\n=========\n\n[Back to TOC](#table-of-contents)\n\nEnglish Mailing List\n--------------------\n\nThe [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers.\n\n[Back to TOC](#table-of-contents)\n\nChinese Mailing List\n--------------------\n\nThe [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers.\n\n[Back to TOC](#table-of-contents)\n\nBugs and Patches\n================\n\nPlease report bugs or submit patches by\n\n1. creating a ticket on the [GitHub Issue Tracker](https://github.com/openresty/lua-resty-lrucache/issues),\n1. or posting to the [OpenResty community](#community).\n\n[Back to TOC](#table-of-contents)\n\nAuthor\n======\n\nYichun \"agentzh\" Zhang (章亦春) \u003cagentzh@gmail.com\u003e, CloudFlare Inc.\n\n[Back to TOC](#table-of-contents)\n\nCopyright and License\n=====================\n\nThis module is licensed under the BSD license.\n\nCopyright (C) 2016, by Yichun \"agentzh\" Zhang, CloudFlare Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n[Back to TOC](#table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentzh%2Flua-resty-multipart-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentzh%2Flua-resty-multipart-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentzh%2Flua-resty-multipart-parser/lists"}