Autor Beitrag
Shadowdragon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 143

Win 2000
Delphi 6 Pers., Delphi 7
BeitragVerfasst: Do 27.02.03 16:28 
Also, hab die INDY-Komponente installiert, funzt alles wunderhübsch.

So, jetzt will ich, dass ich mit einer IDFTP-Komponente auf den FTP-Server zugreife und eine Textdatei hole. Dafür hab ich 2 Buttons, einen für's Hochladen (Button2) und einen fürs Runterladen (Button1).

Code soweit:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Button1Click(Sender: TObject);
begin
try
idftp1.Get('www.meineseite.de/textfile.txt', 'C:\textfile.txt')  ;
except showmessage('Fehler bei Übertragung')
end;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
try
idftp1.Put('C:\textfile.txt')
except showmessage('Fehler bei Übertragung')
end;
end;

end.


User und Passwort sind eingetragen und stimmen.

Beim Programmstart springt die Anwendung in die IDFTP.pas über und zeigt die Meldung
Zitat:
Destination file already exists

Das sollte aber dem Programm doch egal sein, wenn ich die Datei RUNTERLADEN will!

Und beim Button2, also dem Hochladen-Button, passiert folgendes:

Zitat:
Connection closed gracefully

Dann hält es wieder in der IDFTP.pas an, Kommentar is folgend:

If this is a CLIENT (isses ja!)
-------------------
The server side of this connection has disconnected normaly but your client has attempted
to read or write to the connection. You should trap this error using a try..except.
Please see the help file for possible further information.
------------------

Was mache ich da falsch? Danke schonmal im Voraus, bin halt ein N00b :(

_________________
Ein Programm gleicht dem Prinzip von Jenga:
Viele Bestandteile, wird nach oben hin immer besser, nach unten hin immer instabiler und wenn man was falsch macht klappt der ganze Mist zusammen.
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Do 27.02.03 18:23 
Zitat:
Destination file already exists

...klingt so als ob 'C:\textfile.txt' auf deiner platte schon existiert!

Zitat:
If this is a CLIENT (isses ja!)
-------------------
The server side of this connection has disconnected normaly but your client has attempted
to read or write to the connection. You should trap this error using a try..except.
Please see the help file for possible further information.

...hmm :? Sieht so aus als ob die verbindung unterbrochen ist und du trotzdem schreibst! vielleicht reconnecten.

Reagiertst du auf das disconnect event? und hast du ne abfrage ob die connection noch steht? Hast du nen schutz-block (try/except/finally) wenn du hochlädst?

mfg mx.