![]() |
Indy Datei upload
Hallo,
bei den Indy Demos habe ich folgenden codeschnippsel für den Upload einer Datei gefunden:
Delphi-Quellcode:
alles schön und gut, doch ich muss doch bei php eine namenszuweisung für ne datei haben...mit welchem Namen wird die Datei aber an das Script gesendet?
begin
Response := TStringStream.Create(''); try if not bPostFile then HTTP.Post(cbURL.Text, mePostData.Lines, Response) else begin Source := TMemoryStream.Create; try Source.LoadFromFile(edPostFile.Text); HTTP.Post(cbURL.Text, Source, Response); finally Source.Free; end; end; memoHTML.Lines.Text := Response.DataString; finally Response.Free; end; end; end; finally Screen.Cursor := crDefault; btnStop.Enabled := False; btnGo.Enabled := True; end; Hier mal der PHP Code
Code:
$uploaddir = 'files/';
$uploadfile = $uploaddir. $_FILES['archive']['name']; print "<pre>"; if (move_uploaded_file($_FILES['archive']['tmp_name'], $uploadfile)) { print "File is valid, and was successfully uploaded. "; print "Here's some more debugging info:\n"; print_r($_FILES); } else { print "Possible file upload attack! Here's some debugging info:\n"; print_r($_FILES); } $_FILES['archive']['name'] ist ja die namenszuweisung also archive...diese kann ich aber bei delphi nicht übergeben...oder gibts da nen standard für? |
Re: Indy Datei upload
niemand ne idee?
|
Re: Indy Datei upload
push
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz