sami,
What I have done is created a form that has a Drag and Drop handler that
then goes through the collection that has been dropped onto the form.. and
in the bg the files are the transfered via: ftp using a 3rd party
component..
It is just a segement of the BIG picture... hahah I know you want for
delphi6... just trying to let you know it is possible :)
lenn dolling
white crow coding
### Code below is called after the drag and drop handler properly stuffed
the filename collection ### into a filename string array...
COPYRIGHT 2006-2007 WHITE CROW CODING - SKYBOARD - Part of EarthSystems
procedure adoHelperThread.AddNewFiletoDB;
var
loop : integer;
FileStream : TStream;
extension : string;
blob : TStream;
filename : string;
fs : tfilestream;
begin
if user.droppedfilescount >= 1 then
for loop := 1 to user.droppedfilescount do
try
extension := lowercase(rightstr(user.droppedfiles[loop],4));
if extension = '.jpg' then
user.droppedfiles[loop] := JPEGtoBMP(user.droppedfiles[loop]);
FileStream := TFileStream.Create(user.droppedfiles[loop], fmOpenRead);
try
frmEarthChat.ftpHelper.HostFileName :=
ExtractFileName(user.droppedfiles[loop]);
frmEarthChat.ftpHelper.LocalStream := FileStream;
frmEarthChat.ftpHelper.Binary := true;
frmEarthChat.ftpHelper.DisplayFileFlag := false;
frmEarthChat.ftpHelper.Transmit;
finally
frmEarthChat.ftpHelper.LocalStream := nil;
FileStream.Free;
end;
frmEarthChat.debugmsg('File Sent > ' +
frmEarthChat.ftpHelper.HostFileName,2);
except
frmEarthChat.debugmsg('Error Uploading File > ' +
user.droppedfiles[loop],1,clred);
end;
application.ProcessMessages;
if user.droppedfilescount >= 1 then
begin
frmEarthChat.adoqHelperThread.close;
frmEarthChat.debugmsg('Adding Files to DB',1,clWebLightSteelBlue);
frmEarthChat.adoqHelperThread.SQL.Clear;
// could do ?? frmEarthChat.adoqHelperThread.SQL.Add('SELECT * FROM
tblGallerynames WHERE (galleryname like ' + char(39) + user.atGalleryName +
char(39) + ')');
frmEarthChat.adoqHelperThread.SQL.Add('SELECT * FROM tblImages WHERE ID=1');
frmEarthChat.adoqHelperThread.Open;
for loop := 1 to user.droppedfilescount do
try
frmEarthChat.adoqHelperThread.Insert;
frmEarthChat.adoqHelperThread.edit;
frmEarthChat.adoqHelperThread.FieldByName('filename').AsString :=
ExtractFilename(user.droppedfiles[loop]);
frmEarthChat.adoqHelperThread.FieldByName('createdon').Value := now;
frmEarthChat.adoqHelperThread.fieldbyName('ownerID').Asinteger :=
user.ID;
// frmEarthChat.adoqHelperThread.fieldbyName('width').AsString
:=inttostr(user.clickedX);
// frmEarthChat.adoqHelperThread.fieldbyName('height').AsString :=
inttostr(user.clickedY);
frmEarthChat.adoqHelperThread.fieldbyName('filetype').AsString :=
ExtractFileExt(user.droppedfiles[loop]);
frmEarthChat.adoqHelperThread.fieldbyName('galleryname').AsString :=
user.atGalleryName;
// frmEarthChat.adoqHelperThread.fieldbyName('height').AsInteger := 0;
// frmEarthChat.adoqHelperThread.fieldbyName('width').AsInteger := 0;
frmEarthChat.adoqHelperThread.fieldbyName('info').AsString := '';
frmEarthChat.adoqHelperThread.fieldbyName('catagory').AsString :=
'public';
filename := extractfilename(user.droppedfiles[loop]);
frmEarthChat.adoqHelperThread.fieldbyName('imagetag').AsString :=
leftstr(filename,length(filename)-4);
// frmEarthChat.adoqHelperThread.FieldByName('binarydata').Create)/
//LoadFromFile(user.droppedfiles[loop]);
{try
blob :=
frmEarthChat.adoqHelperThread.CreateBlobStream(frmEarthChat.adoqHelperThread.FieldByName('binarydata'),
bmWrite);
try
blob.Seek(0, soFromBeginning);
fs := TFileStream.Create(user.droppedfiles[loop], fmOpenRead or
fmShareDenyWrite);
try
blob.CopyFrom(fs, fs.Size)
finally
fs.Free
end;
finally
blob.Free
end;
finally
end; }
frmEarthChat.adoqHelperThread.UpdateBatch;
//StatusBar1.Panels.Items[0].Text := activeID;
frmEarthChat.debugmsg('Adding File to Database > '+
user.droppedfiles[loop] ,1);
except
frmEarthChat.debugmsg('Error Adding new File',1,clWebLightSteelBlue);
end;
frmEarthChat.adoqHelperThread.close;
end;
>From: Samuel Lujan Navarro <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: RE: [delphi-en] uploading from desktop to web site
>Date: Wed, 10 Jan 2007 16:38:39 +0100 (CET)
>
>
>Take a look at http://www.indyproject.org/ I think there's something that
>you are looking.
>
>Sami
>
>ronc_92127 <[EMAIL PROTECTED]> escribió: I
>have a Delphi 6 Enterprise desktop app that the user wants to be
> able to click on a button and upload some data to their web site.
> Anyone know how to go about this?
>
> Thanks.
>
>
>
>
>
> __________________________________________________
>Correo Yahoo!
>Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
>Regístrate ya - http://correo.yahoo.es
>
>[Non-text portions of this message have been removed]
>
_________________________________________________________________
Your Space. Your Friends. Your Stories. Share your world with Windows Live
Spaces. http://discoverspaces.live.com/?loc=en-CA
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/delphi-en/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/