开发者

How to upload a file from app in VC++ 6 to a web server?

I have an application in VC++ 6 (not MFC) , feature requires it to upload a file to a web server on regular basis. Web server开发者_如何学C is under our control, anonymous upload scripts/page are already setup that would accept a file manually.

How to program in VC++ 6 to upload? which classes to use? I understand it is much possible with smtp and ftp but how through http?


On Windows 2000 upwards, you could use InternetWriteFile API

Open session using InternetOpen

Open URL using InternetOpenUrl

and create buffers to read file from the filesystem and use InternetWriteFile to send it to the server opened by InternetOpenUrl

To use HTTP specifically, you could use WinHttpWriteData API

support functions needed for this is similar to the above, and it's well defined on MSDN

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜