handle generated media files
-
in my plugin i have generated an file dynamic that i want to put into the users media
i can’t use
$filepath = $apk->Generate(); // Move the file to the blog_id dir $wp_filetype = wp_check_filetype( basename( $filepath ), null ); $aFile["name"] = basename( $filepath ); $aFile["type"] = $wp_filetype; $afile["tmp_name"] = $filepath; $attach_id = media_handle_sideload( $aFile, $post_id, 'This is optional file title' ); wp_redirect($_POST['_wp_http_referer']);
$wp_filetype returns two empty keys
and media_handle_sideload result to an empty blank site
- The topic ‘handle generated media files’ is closed to new replies.