Daniel Hardman
2006-08-07 23:12:49 UTC
Can anybody tell me how to use winhttp to upload a file where the size
is not known when I open a connection? All the samples for winhttp and
wininet show the setting of a size as a parameter to
WinHttpSendRequest, then looping on WinHttpWriteData till the size is
met. I have an app that generates massive data files (tens to hundreds
of GB in some cases) where the size is not known in advance, and it is
totally unacceptable to cache the file locally before beginning upload.
Can I pick some placeholder size that will always be big enough for the
upload, then manually twiddle the headers at the end to tell the server
that I've finished my upload cleanly?
is not known when I open a connection? All the samples for winhttp and
wininet show the setting of a size as a parameter to
WinHttpSendRequest, then looping on WinHttpWriteData till the size is
met. I have an app that generates massive data files (tens to hundreds
of GB in some cases) where the size is not known in advance, and it is
totally unacceptable to cache the file locally before beginning upload.
Can I pick some placeholder size that will always be big enough for the
upload, then manually twiddle the headers at the end to tell the server
that I've finished my upload cleanly?