I have a file to upload to a server API and found this thread which I followed – in my case, I have to add some headers too which are working with different API methods from this server. But everything I tried – taking the direct approach as in the link
curl.FormAdd curl.kFormFilename, log.name, curl.kFormFile, log.URLPath
or being a bit more verbose
curl.FormAdd curl.kFormFilename, log.name, curl.kFormFileContent, s, curl.kFormContentsLength, s.bytes, curl.kFormContentType, "text/csv"
(where s is the content of log)
being followed by a curl.FormFinish
of course
results in just a handful of bytes being transferred, and so no file arrives in the API.
Apparently I must be doing something wrong. But what?
5 posts - 2 participants