FTP (Webcam)
-
Ich habe ein Programm geschrieben, welches Bilder von meiner WebCam abholt und dann auf meine Homepage läd (ftp).
Beim Upload mit dem Kompo "NMFTP" bekomme die Fehlermeldung: Im Projekt Project1.exe ist eine Exception der Klasse EIdConnClosedGracefully aufgetreten.
Meldung: 'Connection Closed Gracefully.'.Was bedeutet dies? Was kann ich tun?
Danke!
hier die Source:
TMemoryStream *file2 = new TMemoryStream(); bool Status=false; bool Status2=false; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { Status=!Status; if(!Status) { NMFTP1->Disconnect(); Button1->Caption="Verbinden"; } if(Status) { NMFTP1->Host="janikboehm.ja.funpic.de"; NMFTP1->UserID="janikboehm"; NMFTP1->Password="****"; NMFTP1->Connect(); Button1->Caption="Trennen"; Button2->Click(); } } //--------------------------------------------------------------------------- void __fastcall TForm1::NMFTP1ConnectionFailed(TObject *Sender) { Application->MessageBox("Fehler!","",0); } //--------------------------------------------------------------------------- void __fastcall TForm1::NMFTP1Failure(bool &Handled, TCmdType Trans_Type) { Application->MessageBox("Fehler!","",0); } //--------------------------------------------------------------------------- void __fastcall TForm1::NMFTP1InvalidHost(bool &Handled) { Application->MessageBox("Falscher Host Name!","",0); } //--------------------------------------------------------------------------- void __fastcall TForm1::NMFTP1Connect(TObject *Sender) { Label6->Caption="Aktiv"; Label6->Font->Color=clGreen; Button2->Enabled=true; } //--------------------------------------------------------------------------- void __fastcall TForm1::NMFTP1Disconnect(TObject *Sender) { Label6->Caption="Inaktiv"; Label6->Font->Color=clRed; Button2->Enabled=false; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { String url = "http://192.168.1.20/IMAGE.JPG"; IdHTTP1->Get(url,file2); file2->SaveToFile("test.jpg"); NMFTP1->Upload("test.jpg","image.jpg"); delete file2; } //---------------------------------------------------------------------------gruß Fredi

-
Das kommt nicht von der FTP- sondern von der Indy-HTTP-Komponente.
Siehe http://www.indyproject.org/KB/ unter 'Exceptions'.
-
Danke hat geholfen!