Forminator – wp_remote_post an uploaded file on form submit
-
Hello! I’ve searched the forum and internet for a way to send files through wp_remote_post after an uploaded file is submitted through Forminator, but couldn’t find a solution to my problem.
The problem at hand is:
I need to send an image/pdf from my wordpress site to a company API. When a user submits the form I am using wp_remote_post to send some data in JSON. The PHP code snippet is a representation of what I am sending currently.$response = wp_remote_post( $target_url, array( 'method' => 'POST', 'timeout' => 45, 'headers' => array(), 'body' => json_encode(array( "USER_ID" => $requestData['ACCID'], "EMAIL" => $requestData['EMAIL'], "PHONE" => $phone, "SERIALNUM" => $requestData['SER'], "SEQID" => $entry_id )), ) );
In addition to this I want to send the file that is in the {upload-1} field of the form. How can I achieve that?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Forminator – wp_remote_post an uploaded file on form submit’ is closed to new replies.