void *到FILE * ...是可能的吗? [英] void* to FILE*... is that possible?

查看:234
本文介绍了void *到FILE * ...是可能的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是所有这些东西的新手,并且我正在开发一个插件.我需要使用libcurl上传文件.问题在于该文件不在磁盘上,其内容上的指针传递给了我的插件.所以我的问题是要上传文件,我需要FILE * var,但是我有void *.我该怎么办?

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?

提前谢谢!

推荐答案

您可以使用读取回调执行上载,而不是提供FILE *,如

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.

这篇关于void *到FILE * ...是可能的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆