From: rellison on
I am trying to do the same as this delphi code in VB6. Does anyone know how
to convert from this code below to the same in VB6???

IEHTTP1.Timeout := 30;
IEHTTP1.MultipartPOST := True;
IEHTTP1.request_headers.Add('Accept: image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg,'+
'application/x-shockwave-flash,
application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap,
application/x-ms-application, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*');
IEHTTP1.request_headers.Add('Referer: ' + fstr_LoTW_Upload_URL);
IEHTTP1.request_headers.Add('Accept-Language: en-us');
IEHTTP1.request_headers.Add('UA-CPU: x86');
IEHTTP1.request_headers.Add('User-Agent: Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1) ; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC
4.0; .NET CLR 2.0.50727;' +
'.NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648; .NET CLR 3.5.21022; WD5EAE LoTW Generator)');
IEHTTP1.request_headers.Add('Host: p1k.arrl.org');

IEHTTP1.request_headers.Add('Connection:Keep-Alive');
IEHTTP1.request_headers.Add('Cache-Control:no-cache');

bolUploadSuccess := False;
intStartPos := 0; // remove false compiler warning about
un-init var
for intUplAttempts := 1 to conMaxUploadAttempts do begin
IEHTTP1.AddMultipartFormFile('upfile', strTQ8FileName);
//IEHTTP1.URL := 'https://p1k.arrl.org/lotw/upload';
IEHTTP1.URL := fstr_LoTW_Upload_URL;
try
IEHTTP1.Execute;


TIA Rick
From: Nobody on
"rellison" <rellison(a)discussions.microsoft.com> wrote in message
news:11BC618F-C3A8-48B0-9E22-3ED4D9F68590(a)microsoft.com...
>I am trying to do the same as this delphi code in VB6. Does anyone know how
> to convert from this code below to the same in VB6???

Maybe you could modify this sample which already supports HTTPS. In the
sample form, look for "Secure" check box. Also, when specifying a URL, don't
include the "http://" part. The sample doesn't upload files, but I think you
find demo VB code that does that part.

SAMPLE: Vbhttp.exe Demonstrates How to Use HTTP WinInet APIs in Visual Basic
http://support.microsoft.com/kb/259100/en-us