I was wondering it it's possible to somehow automatically attach an image to input type="file" that is on my server.
For example, I want the user to go to the page that shows a form, but when they submit the form it submits picture.png with it.
<form action="server I wanna send the picture too">
<input type="text">
<input type="file" value="picture.png" name="img" style="display:none;">
</form>
If it's not possible this way, is it possible in curl?
curl_setopt($ch, CURLOPT_URL, 'server I wanna send the picture too');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'img='.file_get_contents('picture.png'));
$answer = curl_exec($ch);
if (curl_error($ch)) {
echo curl_error($ch);
}