06-18-2020, 04:50 AM
i have used TMultipartFormData
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
maybe the error in the php script ? it works normal from html
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

