How to use TCEFUrlRequestClientComponent to upload file?
Posted: Sat May 13, 2023 3:31 am
I want to upload file to a PHP server. So I modified URLRequest Demo code by changing SetToBytes to SetToFile in CreatePOSTRequest function.
Then I click "Send POST request" button, it shows 'Parameters sent!'. But The server didn't receive the file.
Html code can upload the file sucessfully.
Then I click "Send POST request" button, it shows 'Parameters sent!'. But The server didn't receive the file.
Html code can upload the file sucessfully.
Maybe enctype in html is important, But I don't know how to set it in CreatePOSTRequest.<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>