• 3 odgovora
  • 2.482 pregleda
Upload fajla pomocu delphi aplikacije 14.11.2010. u 13:32 · pre 194 meseci #1
Pozdrav...
Nikako mi ne polazi za rukom da napravim program kojim bi izvrsio upload odredjenog fajla na www.megaupload.com ili neki slican sajt.Koristio sam i google ali nista znacajnije nisam uradio.
Da li imate neku ideju kako to da uradim?
Gde mogu da nadjem neki tutorial,source code?
Hvala
Re: Upload fajla pomocu delphi aplikacije 16.11.2010. u 00:48 · pre 194 meseci #2
Nasao sam resenje.

Code:

procedure TForm1.Button1Click(Sender: TObject);
var
ftp: TChilkatFtp2;
success: Integer;
localFilename: String;
remoteFilename: String;

begin
ftp := TChilkatFtp2.Create(Self);

//  Any string unlocks the component for the 1st 30-days.
success := ftp.UnlockComponent('Anything for 30-day trial');
if (success <> 1) then
  begin
    ShowMessage(ftp.LastErrorText);

  end;
ftp.Hostname := 'hostname';
ftp.Username := 'YourUsername';
ftp.Password := 'YourPassword';
ftp.Passive := 1;
success := ftp.Connect();
if (success <> 1) then
  begin
    ShowMessage(ftp.LastErrorText);
  end;
success := ftp.ChangeRemoteDir('YourDir');
if (success <> 1) then
  begin
    ShowMessage(ftp.LastErrorText);
  end;
localFilename := 'FileForUpload';
remoteFilename := 'FileName';
success := ftp.PutFile(localFilename,remoteFilename);
if (success <> 1) then
  begin
    ShowMessage(ftp.LastErrorText);
  end;
ftp.Disconnect();
ShowMessage('File Uploaded!');
end;



Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme