Autor Beitrag
Arnulf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Di 24.05.05 15:56 
Hallo
ich verwende idhttp.get methode um ein file runter zu laden.
da ich das in einen filestream speicher, brauch ich aber vorher den filenamen.
wie bekomm ich den?
Danke
Arnulf
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 24.05.05 16:02 
get verlangt doch eine URL oder? und die zeichen hinter dem letzten "/" sind der dateiname, oder? versuchs mal mit den funktionen Suche in: Delphi-Forum, Delphi-Library COPY und Suche in: Delphi-Forum, Delphi-Library POS... die sind ganz praktisch in solchen sachen. vielleicht funktioniert sogar ExtractFileName. Aber ich bin mir nicht sicher, einfach mal die OH aufrufen.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Arnulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Di 24.05.05 16:10 
naja das stimmt leider nicht.
wenn ich eine php download seite hab, dann steht der filename nicht unbedingt drin.
es könnte ja so ausschauen:
www.brothers-of-deat...php&contentid=88

dann bekommt ich den filenamen leider nicht so einfach :(

Arnulf
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 24.05.05 16:54 
ok. dann weis ichs nich. aber das geht sicher auch iwie :oops: aber ich vermute, dass du dazu ne andere Komponente brauchen wirst..

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Arnulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Di 24.05.05 17:03 
hm...
naja die frage ist doch wie macht das ein webbrowser?
der fragt mich ja auch wohin ich das file mit dem richtigen namen speicher will.
Ist für mich kaum vorstellbar, daß es mit indy nicht gehen soll aber wenn das so ist nehm ich hald eine andere komponente - die frage ist dann welche?

oder gibts doch eine möglichkeit mit indy - hoffentlich :(
Ich kann das problem in diversen foren nicht finden.
Kaum vorstellbar, daß das noch niemand machen wollte, hat noch niemand einen eigenen browser mit dateidownload geschreiben?
oje oje - warum hab immer ich solche probleme :lol:
Arnulf
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 25.05.05 09:02 
steht doch bestimmt im header drin. schau dir den HTTP Header, den du bekommst mal an !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Arnulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Mi 25.05.05 22:36 
idhttp.head
ja so gehts danke
Arnulf
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 26.05.05 09:11 
poste doch auch bitte immer den code, wie du das gelößt hast, damit andere leute, die das gleiche Problem wie du haben eine Lösung finden !
danke

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Arnulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Do 26.05.05 19:27 
ja hat recht - ist besser für die suche :)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  IdHTTP1.ConnectTimeout := 5000;
  IdHTTP1.ReadTimeout := 5000;
  IdHTTP1.RedirectMaximum := 15;
  IdHTTP1.HandleRedirects := True;

  IdHTTP1.Head(edit1.Text);
  ShowMessage(IdHTTP1.Request.URL);
  ShowMessage(IdHTTP1.Response.RawHeaders.Text);
  showMessage(idhttp1.ResponseText);


allerdings hab ich damit ein problem - vielleicht kann mir da wer helfen!
wenn ich auf eine php seite gehe, dann bekomm ich im delphi ide ein read timeout bei den indys.
bei einem dirrekten link nicht.

bei einem kompilierten programm dauter es bei einer php seite nur länger - obwohl ich kein try except verwende.
Kann mir das jemand erklären - bzw. was mach ich falsch :)
hier zwei links die auf die gleiche recource zeigen - einmal mit php einmal ohne:
www.brothers-of-deat...load=go&mirror=1
www.brothers-of-deat...d/Kmarzo-StRenan.pk3

Arnulf
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 27.05.05 09:02 
hast du HandleRedirectsauf true?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Arnulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 27.05.05 09:38 
Zitat:
hast du HandleRedirects auf true ?

steht das nicht eh in dem code den ich gepostet hab?
Zitat:
IdHTTP1.HandleRedirects := True;

ja hab ich. sonst würde ich auch bei request nicht den definitiven link bekommen.
ich versteh einfach nicht, warum der so lange braucht um mir die infos zu liefern - bzw. warum ich im delphi ide ein read timeout bekomme :(

Hoffe es weiß jemand etwas dazu...
Arnulf