Autor Beitrag
pigfacejoe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: So 22.04.07 15:57 
Hallo zusammen,

Mit IdHTTP kann man ja Dateien von Servern runterladen, kann ich dann eigentlich auch mit der lokalen IP Adresse von einem PC in meinem Netzwerk eine datei von PC1 auf meinen PC "downloaden", also auch mit IdHTTP? Falls ja, könnte mir vlt jem. erklären wie das geht?

Schönen Gruss,
PigfaceJoe
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 22.04.07 16:01 
Dafür muss dann auf dem anneren lokalen PC ein HTTP-Server laufen.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
pigfacejoe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: So 22.04.07 16:05 
danke für die schnelle Antwort, aber ich kann doch einfach schreiben idhttp1.get(blabla/bla.exe) wieso kann ich eigentlich dann nicht schreiben idhttp1.get(84.213.231.83/C:\bla.exe) [oder so ähnlich^^]?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 22.04.07 16:15 
idHTTP nutzt einen HTTP-Server. Und wenn da keiner läuft, gehts mit idHTTP nicht.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
pigfacejoe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: So 22.04.07 16:21 
dankeschön, habs kapiert.
Kennst du vlt. einen Thread, indem beschrieben wird, wie das geht?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 22.04.07 16:34 
Entweder du installierst nen Apachen, oder du suchst hier im Forum mal nach idHTTPServer.
Am einfachsten wäre es aber, wenn du Netzwerkfreigaben verwenden würdest.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: So 22.04.07 16:40 
Aber wieso willst du die Datei denn unbedingt über HTTP verschicken? Da gibts doch Protokolle, die für sowas wesentlich besser geeignet sind. Wie gerade gesagt, Netzwerkfreigaben z.B.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
pigfacejoe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: So 22.04.07 16:53 
Nun ja, ich weiss halt nicht, wie das anders geht (ich weiss auch nicht wies so geht) aber ich hatte gerade einen Netzwerk Chat programmiert mit IdTCPServer und Client und wollte halt noch "einen draufsetzen"^^.
Alsow enn jm weiss wies in etwa geht kann ers ja mal posten , wär echt nett.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 22.04.07 16:55 
Haste meinen Post gesehen? :wink:
Da stehen schon geeigenete Begriffe, einfach mal danach suchen...

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: So 22.04.07 16:56 
Oder les die Datei ein und verschick den Inhalt auch über TCP.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
pigfacejoe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: So 22.04.07 17:32 
Hab ich ma gesucht und probiert, leider wills net so recht, hier mal der code zum senden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure senden;
var
St: TfileStream;
begin
if b then

begin
showmessage(form3.ip);//Einfach nurn test, ob die richtige IP drinn is..
form3.idtcpclient1.host:=form3.ip;
  form3.idtcpclient1.boundPort:=5300;
  St := TfileStream.Create(form3.opendialog1.filename,fmOpenRead) ;
  St.Seek(0, soFromBeginning);
  form3.IdTCPClient1.Connect;
  try
    form3.IdTCPClient1.WriteStream(St, True, true);
  finally
    form3.IdTCPClient1.Disconnect;
  end;
  St.Free;
end;

so der Server macht auf Ruf das hier:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.IdTCPServer2Execute(AThread: TIdPeerThread);
var
I,z: Integer;
St: TfileStream;
begin

St := TfileStream.Create(Extractfilepath(Paramstr(0))+'bla.jpg',fmCreate);
try
   with AThread.Connection do begin
     I := ReadInteger;
     ReadStream(St, I);
   end;
finally
   St.Free;
end;
end;

Der Fehler kommt dann "Cannot bind socket, Port already in Use" hab den Port aber freigegeben und er müsste frei sein.Ich habe probiert von meienem PC auf meinen zu senden und habe ein .jpg Bild als File ausgewählt...Jemand ne Idee was da falsch sein könnte?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 23.04.07 07:20 
Hallo,

bitte erstelle für jede deiner Fragen ein separates Topic, da die Diskussion mehrerer Fragen in einem Topic für gewöhnlich für Verwirrung und Durcheinander sorgt.

Viele Grüße, Matze

_________________
In the beginning was the word.
And the word was content-type: text/plain.