Autor Beitrag
klezmor
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Di 18.03.08 00:15 
Ich möchte per http eine datei runterladen, welche sich auf einem server im stammverzeichnis befindet. Da ich allerdings nicht den Namen der Datei kenne, möchte ich mir in einer listbox alle Dateien, welche im stammverzeichnis liegen anzeigen lassen, weiß jemand wie man das mit idhttp macht?

MFG Klezmor

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 18.03.08 04:36 
ich würde sagen, gar nicht, weil das nicht bestandteil des HTTProtocols ist.
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Di 18.03.08 09:50 
Ich habe nämlich einen account bei home.arcor.de und kann dort dateien per ftp hochladen. Um die dateien einzusehen kann ich aber einfach afu die adresse home.arcor.de/test und befinde mich im wurzelverzeichnis, von wo aus ich in verschiedene ordner schauen kann und ich alle dateien welche sich im wurzelverzeichnis befinden sehen kann.
Wenn das also mein browser kann(mozilla firefox), dann müsste es ja auch mti delphi gehen. Kann mir nicht vorstellen, dass firefox zig tausend möglichkeiten durchgeht und überprüft, ob zufällig eine datei namens bla.txt auf dem server liegt.

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 18.03.08 12:02 
Da hast du recht! Die gehen nicht zig tausend Möglichkeiten durch, die haben einfach nachgedacht und sind zu dem Schluss gekommen, daß es sinnvoll sein könnte, das FTProtocol in ihre Browser zu implementieren. Also tu du das auch und mach es mit TIdFtp! ;)

es kann natürlich auch sein, daß in deinem speziellen fall arcor das server-seitig so implemetiert hat. eben daß der server ne liste ausspuckt, wenn du ihn um ein verzeichnis bittest...
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Di 18.03.08 16:28 
aber ich möchte Dateien runterladen ohne mich über ftp einloggen zu müssen, über http geht das ja auch, wie mache ich dass dann per ftp?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
PeterPain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83



BeitragVerfasst: Di 18.03.08 16:49 
Du meinst vermtl das directory listing, das viele webspace anbieter anbieten. Die ausgabe findet da allerdings in HTML statt. Ergo musst du entweder den HTML ouput des listings parsen, oder dich per FTP client einloggen (TIdFTP). Das is nich weiter schwer, und wie es funktioniert findest du auf hundertausend seiten beschrieben.

gruss
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Mi 19.03.08 12:20 
Es ist halt so dass ich die inhalte auf meinem ftp server zwar der öffentlichkeit zugänglich machen will, diese die Inhalte allerdings nicht ändern können soll, ich selbst verbinde mich selbstverständlcih über ftp, ist auch weiter kein problem, habe ich schon öfters gemacht wens interessiert die einfachste möglichkeit ist denke ich idftp, beschrieben hier.

user profile iconPeterPain hat folgendes geschrieben:
Du meinst vermtl das directory listing, das viele webspace anbieter anbieten. Die ausgabe findet da allerdings in HTML statt. Ergo musst du entweder den HTML ouput des listings parsen


genau das will ich machen, aber weiß nicht wie es geht. Ist das unter umständen sogar schon in idhttp gekapselt?

Gruß Klezmor

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Fr 21.03.08 13:04 
Keiner ne Ahnung wie man das Listing ohne einzuloggen über http oder ftp auslesen kann?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 22.03.08 21:39 
geht das jetzt mit http oder muss man es üer ftp machen`?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
PeterPain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83



BeitragVerfasst: Sa 22.03.08 21:46 
Hab ich doch gesagt...

Du holst dir den HTML Code per idHttp, zerlegst (parsed) den in seine Bestandteile, und machst dann damit, was auch immer du damit machen willst ;)

grüsse
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Sa 22.03.08 21:48 
Vielleicht kannst du für deinen Server einen Username mit Passwort erstellen, der nur Leserechte hat. Dann ist es auch nicht schlimm, wenn sich jemand in dein Programm einhackt und das Passwort rausfindet. Ich denke, der Service per HTTP wird dir nur gegeben, wenn du eingeloggt bist. Aber bevor du deinem Programm Zugriff auf alle Einstellungen der Domain gibst, solltest du den FTP-Zugang auch mit Schreibrechten vorziehen.
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: So 23.03.08 02:02 
user profile iconPeterPain hat folgendes geschrieben:
Hab ich doch gesagt...

Du holst dir den HTML Code per idHttp, zerlegst (parsed) den in seine Bestandteile, und machst dann damit, was auch immer du damit machen willst ;)

grüsse


und wie hole ich den?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
PeterPain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83



BeitragVerfasst: So 23.03.08 05:11 
user profile iconklezmor hat folgendes geschrieben:
user profile iconPeterPain hat folgendes geschrieben:
Hab ich doch gesagt...

Du holst dir den HTML Code per idHttp, zerlegst (parsed) den in seine Bestandteile, und machst dann damit, was auch immer du damit machen willst ;)

grüsse


und wie hole ich den?



Indem du die Fähigkeit des lesens erwirbst (oder holen einfach mal ins englische übersetzt).
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: So 23.03.08 12:51 
ausblenden Delphi-Quelltext
1:
S := IdHTTP1.Get('URL');					

bzw.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var Post: TStringList;
Post := TStringList.Create;
try
  Post.Add('Name=Value');
  Post.Add('Name=Value');
  S := IdHTTP1.Post('URL', Post);
finally
  Post.Free;
end;