WordPress media upload multiple images

Make sure the permissions for the upload folder are set correctly, and that none of WordPress’s files have been deleted. Also, try disabling all plugins. If it still doesn’t work, try adding this to the .htaccess file: <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> Test and see if it will work on a small image, … Read more

upload file with front-end submission and forward the data in an email

In case anyone needs this, here is my solution: if ($_FILES) { function insert_attachment($file_handler, $post_id, $setthumb = ‘false’) { if ($_FILES[$file_handler][‘error’] !== UPLOAD_ERR_OK) __return_false(); require_once(ABSPATH . “wp-admin” . ‘/includes/image.php’); require_once(ABSPATH . “wp-admin” . ‘/includes/file.php’); require_once(ABSPATH . “wp-admin” . ‘/includes/media.php’); $attach_id = media_handle_upload( $file_handler, $post_id ); //get url $attachment_url = wp_get_attachment_url($attach_id); add_post_meta($post_id, ‘_file_paths’, $attachment_url); $attachment_data = … Read more

Metabox with file upload to custom directory

I will not follow the whole metabox thing, but Just to point some ” leads ” as you asked regarding the upload folder .. The upload dir in wordpress is set via the wp_upload_dir() function – which is filterable .. $uploads = apply_filters( ‘upload_dir’, array( ‘path’ => $dir, ‘url’ => $url, ‘subdir’ => $subdir, ‘basedir’ … Read more