Closed danielsetreus closed 5 years ago
Faced the same problem
@danielsetreus We could isolate the array keys which are an instanceof \CURLFile and add them after processing the http_build_query() data?
@danielsetreus https://github.com/php-mod/curl/pull/53/files this should fix the problem - right?
POSTing files does not work as intended.
This is what I'd like to do:
However what is posted is a string representation of the data, including the CURLFile instance, not the actual file. I.e:
mode=import&file%5Bname%5D=path/to/file/&file%5Bmime%5D=mime_type_of_file&file%5Bpostname%5D=file_post_name
This is due to the
preparePayload
method - that runshttp_build_query
on the data. If I remove those lines everything works as expected.The library should include a way to skip
http_build_query
, or a special method for adding a file to the posted data.Thanks