i have a form which has a file input like below, i'd like to upload the file selected by user(on their device) to another server.
<form id="image" method="post" action="/api">
<input name="image" type="file">
<input type="submit" value="submit">
</form>
i have found some answers here and there but they don't seem to work or maybe i can not understand. for example, i have encountered
$post = array (
'image' => curl_file_create('path/to/image');
);
or new CURLFile('path/to/image');
but i don't figure out what 'path/to/image'
is since the image(file) is not saved on the server!
i'd appreciate any help, thanks in advance!
p.s. the form has other inputs as well and the curl sends their data without any problem, the problem is just the file input. just cut out those inputs so the code wouldn't be long.