Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload image with php file
#3
i have used TMultipartFormData

Code:
HttpClient := THTTPClient.Create;
try


HttpClient.AllowCookies := True;
HttpClient.UserAgent := sUserAgent;
HttpClient.HandleRedirects := True;
HttpClient.MaxRedirects := 3;
HTTPClient.ConnectionTimeout := 0;
HTTPClient.ResponseTimeout  := 0;


PostData := TMultipartFormData.Create;
try

try
PostData.AddFile('image', FFileToUpload);
HttpResponse := HttpClient.Post(FdataURL, PostData);
FoutData := HttpResponse.ContentAsString();
except
end;

finally
PostData.Free;
end;




finally
HttpClient.Free;
end;

but i got the same result the response i get is empty and image wont uploaded , the php side has an isset check for submit button with name upload 

Code:
if (isset($_POST['upload'])) {

$imgsize = $_FILES['image']['size'];

maybe the error in the php script ? it works normal from html
Reply


Messages In This Thread
upload image with php file - by Madammar - 06-17-2020, 05:05 PM
RE: upload image with php file - by rlebeau - 06-17-2020, 07:24 PM
RE: upload image with php file - by Madammar - 06-18-2020, 04:50 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)