Have you looked at wp_upload_bits, it will create th file in the upload folder.
Example :
$upload = wp_upload_bits( $_FILES["course_file"]["name"], null, file_get_contents( $_FILES["course_file"]["tmp_name"] ) );
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- Checking if a file is already in the Media Library
- Standard location for plugin to save/cache files?
- Saving data-URI to media library
- Can I use the wp media uploader for my own plugin?
- Change Media Uploader default directory
- Changing upload directory for plugin uploads only
- Upload file to remote storage
- Why are two functions over-riding each other?
- WordPress Media mime type filter problem 4.0
- Using the component outside the editor. select(‘core’) is null
- Proper way to hook wp_get_attachment_url
- Getting Details Of Uploaded Image
- Sharing a common set of image files for media library, across all sites within multisite
- Uploading images from a custom page using blueimp uploader?
- Hook to get image filename when it is uploaded
- How to send email in wordpress with more than one attachments
- Using the default wordpress uploader inside plugin
- Files automatically added
- What filter should I use to insert a button inside on Media>Add New
- Changing upload dir in a plugin regardless of post type
- How to replicate Media Library “Add New” on Plugin Settings Page
- Plugin writing: access file that was just uploaded
- Custom delete option button in plugin settings
- How to enable sorting in custom media uploader in plugin
- Create a new post using rest api and save featured image using an external image url
- Why is the temporary upload always 4.1K
- Upload multiple images and insert them into custom html code
- wp_editor add media button not working
- WordPress Specified file failed upload test
- How to create a digital product download link that can’t be used twice?
- How to submit/upload data to database and in specific folder?
- Cleaning a filename after image sideloading a url that contains `%20`
- Get audio metadata on file upload
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Why doesn’t update_post_meta work for certain strings?
- wp.media Uncaught TypeError: Cannot read properties of undefined (reading ‘state’)
- Insert and read media from the WordPress library and call in the plugin
- Trying to rename a file upload as the hash of file content on wordpress
- Home page is not loading, where in other pages are displaying on the site
- WordPress5.2.3: Better File Download Plugin validation issue
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- Changed media upload path for plugin, but generates error & shows wrong url
- How to destroy or dispose wordpress uploder/manager?
- Displaying $_FILES data (simlar to $_POST)
- Changing upload directory for plugin uploads only
- How do you filter get_media_items by mime type in a custom media upload tab?
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Upload to a specific media folder created by FileBird Lite
- Load images from CDN and custom features to “Add Media” dialogue
- upload image to wordpress media library failed for custom post type
- Plugin Form Submission Best Practice
- How to sync with plugins update after I have done manual optimizations?
- How to retrieve a value via get_option when the option_value is stored in a multi-dimensional array?
- Check spam in custom form – akismet
- Add Admin Menu Inside Construct or Init
- get plugin directory url
- WordPress cron running twice
- How to create thumbnail of different files?
- Admin-ajax.php appending a status code to ajax response
- comment_email hook doesn’t seem to work for comment editor field
- How can I add a field to make link nofollow to the WordPress Link Inspector Window?
- admin_notices not displaying in plugin
- Get Objects While Deleting term
- js/css updating when making a plugin
- settings_fields() doesn’t work for other roles except admin
- Subscribe to author?
- how to make custom bulk actions for a WP_List_Table (core class)
- Set page template programaticlly in plugin
- How to use output buffering in WordPress hooked functions?
- Plugin menu addition in multisite
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- How to get Metabox custom field to show checked if value is updated using post meta query?
- wp_schedule_event seems to be being added twice
- How to Move the Comments Bubble to the Right Side of the Toolbar
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- What happens when two or more plugins use the same hook?
- How to pull user/author profile data in a plugin?
- Adding columns to core tables
- Injecting HTML on (arbitrary) admin pages
- Custom Stylesheet instead of Inline CSS for WordPress Customizer API Overrides
- Information on plugin adding text when a post, page, or other such is displayed
- How to relate the Category to user?
- Plugin’s total number of users
- How to edit wp-signup.php content using plugin
- Setting post_id for single.php based on URL without a redirect
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Is there any way to get post meta from publish_post hook?
- How to create plugin settings page for each admin user?
- Using JavaScript in WordPress page to call for server data using AJAX
- login_message filter not working
- Displaying Custom Post Meta
- Array/List Edit in Backend
- How to Modify My Plugin’s Admin Settings so that the Plugin can be Added to a Specific Page?
- Wrapping shortcodes in another shortcode
- Display Data’s metabox in page
- WordPress multiple user roles accessing on their information on one site?
- How to add ‘use_desc_for_title = 0’ to all wp_list_categories calls?