Skip to content

how to send file body, like file upload #247

Closed

Description

@xiaoliu10

I want to send files, but I can't find examples or documents
like send local file to other server

Activity

  1. xiaoliu10 commented on Aug 26, 2021

    @xiaoliu10
    Author

    Can someone help me

  2. pintsized commented on Aug 27, 2021

    @pintsized
    Member

    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.

  3. xiaoliu10 commented on Aug 29, 2021

    @xiaoliu10
    Author

    Send a file, such as a local file, read the file stream, and then send it to another server

  4. pintsized commented on Aug 29, 2021

    @pintsized
    Member

    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.

  5. locked and limited conversation to collaborators on Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions