Hi all,
Can anyone please advise me how I can insert a PDF file that a user selects from a html form into a custom table in the database?
My code so far is:
$OrderNumber= $_POST['txt_OrderNumber'];
$UploadAttachment = $_POST['txt_Attachment'];
$wpdb->insert('wp_Attachments',
array(
'OrderNumber' => $NextOrderNumber,
'FileContent' => $UploadAttachment
),
array(
'%s',
'%s'
)
);
Although I do not get any errors, the size returned in the database is 0.
Any advice please?