Autor Beitrag
Paprika
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Do 19.06.03 21:16 
Hallo Leute!

Ich möchte eine Datei auf einen WebServer hochladen. Aus Sicherheitsgründen ohne FTP-Zugriff. Ich habe gehört es soll irgendwie mit der Put-Funktion von Indy bzw. Fastnet gehen (NMHTTP1.Put ...)

Keiner konnnte mir sagen wie das so geht ... Ich glaube es liegt daran, dass die meisten in den Delphiforen nur Delphi können und von PHP keine Ahnung haben und deswegen poste ich hier mal meine PHP-Code, die die Datei empfangen und speichern soll. Code:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
<?php
if (isset ($datei))
{
copy ($datei, "files/$datei_name");
unlink ($datei);
}
?>


Ihr wisst garnicht wie sehr ich mich freuen würde, wenn mir endlich Jemand sagen könnte, wie das funzt ... Schon seit Tagen komme ich mit dem Problemm nicht klar.

Ich danke schon im voraus, falls mir Jemand helfen kann.

MfG
Paprika
thebe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

WinXP Home
D6 Enterprise
BeitragVerfasst: Do 19.06.03 21:46 
najaaaaaa
Ich hät nen schimmer was man machen könnt, wird dir aber wohl nit gefallen. Einfach inner URL dann pro Byte die ASCII Zeichen ranhängen.

Bsp: www.test.de/test.php?datei=%3F%A9%23%89

usw.

Denke aber nit das das der Browser mitmachen würd
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 20.06.03 10:36 
lad die dateui doch per http post hoch. das geht genauso und ist soviel ich gehört hab einfacher in php denn um put zu können braucht man nochwas imapache oder ein php modul oder sonst was.

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

Win XP
D5 Ent
BeitragVerfasst: Fr 20.06.03 15:59 
Titel: indy 9
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.UploadFile(Filename, ContentType: string);
var
  Stream: TIdMultiPartFormDataStream;
  StringStream: TStringStream;

begin
Stream := TIdMultiPartFormDataStream.Create;
StringStream := TStringStream.Create('');
try
  Stream.AddFile('datei',Filename, ContentType);
  IdHTTP1.Post(EURL.Text, Stream, StringStream);
  Memo1.Text := StringStream.DataString;
finally
  Stream.Free;
  StringStream.Free;
end;
end;
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 20.06.03 16:07 
genau so !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 21.06.03 12:32 
jetzt hab ich mal nochne frage: hbei mir kommt immer der fehler dass er TIdMultiPartFormDataStream nicht kennt !!! muss ich da noch was einbinden ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 21.06.03 12:33 
hat sich grad erledigt !! :oops:

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