You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would recommend asking this sort of question on a wider forum (such as Stack Overflow). It is certainly possible, but if you don't know how then I assume you need to learn some things about HTTP, and this isn't really the place to do that.
Importantly, it does depend on what you mean by "local file", because typically in OpenResty there is not a safe way to read file data from disk on the fly (it would block Nginx). You would need to read any file data into Lua in advance, during the init phase (i.e when Nginx starts), which may not be what you want. Again though, this is outside of the scope of this project. You would be better off asking for help on the OpenResty mailing lists or similar.
If you have file data in Lua already, and you can figure out how to make the required HTTP request for your use case, then yes, this library is the tool you would use to achieve that.
Again, this is not the best place to ask for help on how to create an OpenResty based solution. I'd suggest reaching out for help on the OpenResty mailing list or other forums.
Activity
xiaoliu10 commentedon Aug 26, 2021
Can someone help me
pintsized commentedon Aug 27, 2021
I would recommend asking this sort of question on a wider forum (such as Stack Overflow). It is certainly possible, but if you don't know how then I assume you need to learn some things about HTTP, and this isn't really the place to do that.
Importantly, it does depend on what you mean by "local file", because typically in OpenResty there is not a safe way to read file data from disk on the fly (it would block Nginx). You would need to read any file data into Lua in advance, during the
initphase (i.e when Nginx starts), which may not be what you want. Again though, this is outside of the scope of this project. You would be better off asking for help on the OpenResty mailing lists or similar.If you have file data in Lua already, and you can figure out how to make the required HTTP request for your use case, then yes, this library is the tool you would use to achieve that.
xiaoliu10 commentedon Aug 29, 2021
Send a file, such as a local file, read the file stream, and then send it to another server
pintsized commentedon Aug 29, 2021
Again, this is not the best place to ask for help on how to create an OpenResty based solution. I'd suggest reaching out for help on the OpenResty mailing list or other forums.