void* to FILE*… is that possible?

删除回忆录丶 提交于 2019-12-12 04:59:38

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!