Upload file via HTTP from VBA (WinHTTP)

Posted by chiccodoro on Stack Overflow See other posts from Stack Overflow or by chiccodoro
Published on 2010-04-30T07:04:34Z Indexed on 2010/04/30 7:07 UTC
Read the original article Hit count: 500

Filed under:
|
|
|
|

Hi all,

I'm trying to HTTP upload a binary file programmatically from within VBA. I intend to put an ASPX page on the server.

I know there are lots of nice ways to do that (e.g. use web service instead of aspx), but my constraint is that it must run in VBA (in an excel file), and that I cannot install any additional components on the client.

So I guess I'll use WinHTTP, and I've found several examples to post form data, but not to post a binary file. I probably need to base64 the file contents?

If so, please let me know. If I can make WinHTTP do file encoding for me, please let me know. If there is a much better way to reach my goal (Upload file from within VBA, server needn't necessarily be ASPX, could be a ASP.NET-Web service as well), please let me know...

Thx, chiccodoro

© Stack Overflow or respective owner

Related posts about vba

Related posts about winhttp