Lua-cURL / Lua-cURLv3

Lua binding to libcurl
MIT License
279 stars 64 forks source link

Just a doubt #148

Closed otgo closed 5 years ago

otgo commented 5 years ago

I want to add a file in an array, i know i can do this if i want to add a file making a request: curl_var:setopt_httppost(curl.form():add_file("argument", "filename", 'multipart/form-data'))

But if I need to upload a file inside of?

Example, this is the url:

name.domain/file_upload.php?id=123&media={file="filename"}

How do I do that?

moteus commented 5 years ago

I need to upload a file inside of

Sorry, I do not understand what you want You can open file and pass it via writefunction to send it as-is

name.domain/file_upload.php?id=123&media={file="filename"}

This is just URL. You can set it via url option Starting from cURL 7.64.0 i think, provides URL API to work with urls. lua-curl supports it since 0.3.9 version But you can use any other way to build it