Autor Beitrag
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Do 25.08.05 16:16 
ich habe versucht, mit der IdHTTP Komponente Dateien auf z.b. RapidShare.de hochzuladen:

ausblenden Delphi-Quelltext
1:
2:
3:
  Stream.AddFormField('u','upload');
  Stream.AddFile('filecontent','C:\v107.rar''multipart/form-data');
  Form1.IdHTTP1.Post('http://ul2.rapidshare.de/cgi-bin/upload.cgi?rsuploadid=456563016508102307489205610906', Stream, StringStream);


Dies funktioniert auch soweit, mein Fortschrittsbalken füllt sich (IdHTTP1.OnWork), also die Datei wird echt hochgeladen, doch StringStream liefert mir am ende des upload Vorgangs nicht die HTML-Seite die dann im Browser geladen wird wo die links zu der Datei stehen...womit das ganze sinnlos wird da man nicht mehr auf die hochgeladen dateien zugreifen kann.
kann man das irgendwie anders machen sodass man die links bekommt oder is das aufgrund des serverseitigen scripts nicht möglich?
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Do 25.08.05 20:10 
hm, wenns so nich geht, könnte ich die datei vll auch übertragen indem ich mit nem TWebBrowser auf rapidshare.de gehe, das Feld automatisch ausfülle (pfad eintragen) und auf hochladen drücke?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 25.08.05 20:34 
geht doch ganz einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Button3Click(Sender: TObject);
var postdata : tstringlist;
begin
 postdata := tstringlist.Create;
 postdata.Add('domname=vol.at')  ;
 memo1.Lines.Add(idhttp1.Post('http://krazz.net/cgi-bin/whois2.cgi',postdata));
 postdata.Free;
end;

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Do 25.08.05 21:07 
genau da liegt ja mein Problem, bei einem vorherigen Programm wo ich bilder auf imageshack.us hochgeladen hab, hab ich die antwortseite bekommen, aber hier bekomme ich keine antwort!
anscheinend ist das mit einem script gelöst welches irgendwie nur den link in die seite einbaut, diese aber nicht neuläd oder so:

ausblenden Delphi-Quelltext
1:
  Form1.Memo1.Lines.Add(Form1.IdHTTP1.Post('http://ul1.rapidshare.de/cgi-bin/upload.cgi?rsuploadid=738055145554699609209566980850', Stream));					

dieser code bringt mir KEINE antwort vom Server!
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 25.08.05 21:10 
vermutlich weil die uploadid nicht stimmt ?

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 25.08.05 21:38 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button3Click(Sender: TObject);
var s:string;
    stream: TIdMultiPartFormDataStream;
begin
 s:=idhttp1.Get('http://www.rapidshare.de');
 s:=copy(s,pos('action=',s)+8,maxint);
 s:=copy(s,1,pos('"',s)-1);
 stream := TIdMultiPartFormDataStream.Create;
 Stream.AddFormField('u','upload');
 Stream.AddFile('filecontent','C:\fftest.txt''multipart/form-data');
 s:=idhttp1.Post(s,stream);
 s:=copy(s,pos('Download-Link',s)+39,maxint);
 memo1.Lines.add(s);
 stream.Free;
end;

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Do 25.08.05 22:11 
erstmal danke für deine Bemühungen, aber es geht immer noch nicht! :?

habe jetzt nach und nach alles weggenommen, der fehler tritt gleich bei deinem ersten befehl auf! hab schon nen bisschen rumgesucht aber nicht gefunden was das für ein Fehler ist...

hab nen button gemacht der nur folgendes macht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button2Click(Sender: TObject);
begin
 s:=Form1.idhttp1.Get('http://www.rapidshare.de');
end;


sobald ich auf den Button drücke, erscheint in meinem Memo (hab noch die StatusMeldungen von IdHTTP ausgeben lassen)
Resolving hostname rapidshare.de.
Connecting to 80.237.244.61.
Connected.

Jetzt bricht es ab und ich bekomm den Fehler "Range check Error"
was bedeutet das?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 25.08.05 22:49 
keine ahnung. bei meinem code oben habe ich nichts anderes gemacht als ein IdHttp komponete auf das formular zu ziehen (indy das bei d7 dabei is) noch bei uses die unit für den poststream dazugeschrieben, und dann ging es. ich habe keinerlei eigenschaften der idhttp kompo verändert.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Do 25.08.05 23:31 
neues projekt, memo drauf, button drauf, IdHTTP drauf, unter uses IdMultiPartFormData eingetragen, doppelt auf button gedürck und deinen code reingepastet...
F9 gedrückt, auf button gedrückt....RANGE CHECK ERROR :evil: :evil: :evil:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdMultiPartFormData, IdBaseComponent, IdComponent,
  IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    IdHTTP1: TIdHTTP;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var s:string;
    stream: TIdMultiPartFormDataStream;
begin
 s:=idhttp1.Get('http://www.rapidshare.de');
 s:=copy(s,pos('action=',s)+8,maxint);
 s:=copy(s,1,pos('"',s)-1);
 stream := TIdMultiPartFormDataStream.Create;
 Stream.AddFormField('u','upload');
 Stream.AddFile('filecontent','C:\fftest.txt''multipart/form-data');
 s:=idhttp1.Post(s,stream);
 s:=copy(s,pos('Download-Link',s)+39,maxint);
 memo1.Lines.add(s);
 stream.Free;
end;

end.


das is doch echt komisch...vll muss ich einfach mal neustarten? kann ich aber in den nächsten 6-7h nich...also morgen erst :shock:
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 26.08.05 05:23 
hmm ich glaube nicht dass du ne datei namens fftest.txt auf c:\ liegen hast :>
tausch das mal aus...

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 26.08.05 15:44 
doch, hab ich extra angelegt^^
außerdem is das sowieso egal, der fehler tritt noch beim ersten Befehl auf, ich kann den ganzen Rest rausnehmen...

ausblenden Delphi-Quelltext
1:
s:=idhttp1.Get('http://www.rapidshare.de');					


kann es sein das der quelltext irgendwie zu groß is für die variable oder komponente?
kA was "Range check Error" sonst bedeuten könnte....

egal ich start jetzt erstmal neu un probiers dann nochmal :D
EDIT: nix, geht einfach nicht!!!! hier nochmal nen screen meines programms:

[url=img353.imageshack.us...2620051552251pp.jpg]user defined image[/URL]
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 26.08.05 16:18 
keine ahnung ^^
lad dir mal von borland.pl die personal edition von D7 und guck obs damit geht

edit: alternative:
ausblenden Delphi-Quelltext
1:
{$RANGECHECKS OFF}					

oder das downloaden mit Suche in: Delphi-Forum, Delphi-Library URLDOWNLOADTOFILE regeln
oder ne andere bugfreie komponente verwenden.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...