Answer the question
In order to leave comments, you need to log in
How to store image url in database?
I use a regular ajax form to send files as pictures
add_action( 'wp_ajax_comment_upload_image', 'upload_image' );
add_action( 'wp_ajax_nopriv_comment_upload_image', 'upload_image' );
function upload_image() {
if ( !isset( $_FILES['files'] ) && empty( $_FILES['files'] ) ) {
return;
}
$img = file_get_contents( $_FILES['files']['tmp_name'] );
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question