问题
I'm a complete newbie to all this stuff, and I'm developing a plugin. I need to upload a file using libcurl. The problem is that that file is not on the disk, pointer on it's content is passed to my plugin. So my question is that to upload a file I need FILE* var, but I'm having void*. What should I do?
Thank you in advance!
回答1:
You can perform an upload using a read callback instead of providing a FILE *
, as specified in this example. In the callback then you can copy into the given buffer the data to upload.
来源:https://stackoverflow.com/questions/8523318/void-to-file-is-that-possible