<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>I've used the Indy library that comes with Delphi to do 
HTTP uploads with progress notification.&nbsp; Works quite 
well.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>E.g.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>&nbsp; FHTTPClient := TIdHTTP.Create(nil);<BR>&nbsp; with 
FHTTPClient do begin<BR>&nbsp;&nbsp;&nbsp; ProxyParams.ProxyServer:= 
ProxyHost;<BR>&nbsp;&nbsp;&nbsp; ProxyParams.ProxyPort := 
ProxyPort;<BR>&nbsp;&nbsp;&nbsp; ProxyParams.ProxyUsername := 
ProxyUsername;<BR>&nbsp;&nbsp;&nbsp; ProxyParams.ProxyPassword := 
ProxyPassword;<BR>&nbsp;&nbsp;&nbsp; OnWork := 
HTTPWorkEvent;<BR>&nbsp;&nbsp;&nbsp; OnWorkBegin := 
HTTPBeginWorkEvent;<BR>&nbsp;&nbsp;&nbsp; OnWorkEnd := 
HTTPEndWorkEvent;<BR>&nbsp; end;<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>I use it to upload a JPEG to a webserver running Gallery 
(<A href="http://gallery.menalto.com/">http://gallery.menalto.com/</A>) as 
follows:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>function TGalleryHelper.AddImage(const AlbumID: Integer; 
const Image: TStream; const ImageFilename, Caption, Description, Summary: 
String): TGalleryStatus;<BR>var<BR>&nbsp; Command: String;<BR>&nbsp; Response: 
String;<BR>&nbsp; ImageStream: 
TIdMultipartFormDataStream;<BR>begin</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;...<BR>&nbsp;&nbsp;&nbsp; 
ImageStream := TIdMultiPartFormDataStream.Create;<BR>&nbsp;&nbsp;&nbsp; 
try<BR></FONT></SPAN><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[cmd]', 
'add-item');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[protocol_version]', Format('%f', 
[PROTOCOL_VERSION]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[set_albumId]', Format('%d', 
[AlbumID]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[caption]', 
Caption);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[force_filename]', 
ImageFilename);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[extrafield.Summary]', 
Summary);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddFormField('g2_form[extrafield.Description]', 
Description);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.AddObject('g2_userfile', 'image/jpeg', Image, 
ImageFilename);</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response := 
FHTTPClient.Post(Command, ImageStream);<BR>&nbsp;&nbsp;&nbsp; 
finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ImageStream.Free;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; 
...</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV></SPAN><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>The events that the TIdHTTPClient class raises can be handled as 
follows:</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>procedure TGalleryHelper.HTTPBeginWorkEvent(Sender: TObject; AWorkMode: 
TWorkMode; const AWorkCountMax: Integer);<BR>begin</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;// Do something with AWorkCountMax, e.g. set 
the&nbsp;max value on a progress bar.<BR>end;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>procedure TGalleryHelper.HTTPEndWorkEvent(Sender: TObject; AWorkMode: 
TWorkMode);<BR>begin</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;// You're all done.<BR>end;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>procedure TGalleryHelper.HTTPWorkEvent(Sender: TObject; AWorkMode: 
TWorkMode; const AWorkCount: Integer);<BR>begin</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;// Do something with AWorkCount, e.g. 
set&nbsp;the progress value of a progress bar.<BR>end;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff size=2>I have 
all this running in a thread to keep my GUI nice and responsive while the upload 
is happening.</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff size=2>HTH, 
if you've more questions, let me know.</FONT></SPAN></DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=298055419-15092008><FONT face=Arial color=#0000ff 
size=2>Conor</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT size=2><FONT 
face=Tahoma><B>From:</B> delphi-bounces@delphi.org.nz 
[mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Jeremy 
Coulter<BR><SPAN class=298055419-15092008><FONT face=Arial 
color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT size=2><SPAN 
class=156381010-15092008><FONT face=Arial>I am wondering if anyone has seen or 
has any Delphi code that will do an http file upload, BUT that shows you the 
upload progress.</FONT></SPAN></FONT></DIV>
<DIV><SPAN class=156381010-15092008><FONT face=Arial size=2>I have looked at the 
Synapse code for doing this, but it doesn't have the ability to show the 
progress.</FONT></SPAN></DIV>
<DIV><SPAN class=156381010-15092008><FONT face=Arial size=2>Why use HTTP File 
upload and not FTP? simple answer, not every site has FTP enabled...as we have 
found out, and email has been a bit unreliable.</FONT></SPAN></DIV>
<DIV><SPAN class=156381010-15092008><FONT face=Arial size=2>I have taken a look 
at the odd Java plugin that does this which would be good because I could just 
have my app. look at a webpage instead of build it into the exe, but then, no 
guarantees that java is enabled either....sigh...the joys 
:-(</FONT></SPAN></DIV>
<DIV><SPAN class=156381010-15092008><FONT face=Arial size=2>OR someone might 
even have a brighter idea ;-)</FONT></SPAN></DIV></BODY></HTML>