When you use media_handle_upload()
to upload a file, it creates the attachment post in the database and return the ID of the attachment, or a WP_Error
if the upload failed. This ID of the attachment is used to access uploaded file.
See documentation here. and an example here.
So path to your CSV file can be retrieved using get_attached_file()
as follows:
$my_file = get_attached_file( $attachment_id ); // Full path
Documentation for get_attached_file()
is here.
I hope this may help.
Related Posts:
- Files automatically added
- Cleaning a filename after image sideloading a url that contains `%20`
- Displaying $_FILES data (simlar to $_POST)
- How can I add an image upload field directly to a custom write panel?
- Where to store PHP files created by plugin / themes
- 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?
- $wp_filesystem returns NULL. What are the dependencies?
- 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
- 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
- Custom delete option button in plugin settings
- How to implement filesystem cache in WordPress
- How to enable sorting in custom media uploader in plugin
- “dashboard”-named PHP file doesn’t get included
- 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?
- Look for a file in a theme before loading from plugin
- How to submit/upload data to database and in specific folder?
- 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?
- 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?
- upload script in plugin development [duplicate]
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Upload to a specific media folder created by FileBird Lite
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [closed]
- Load images from CDN and custom features to “Add Media” dialogue
- upload image to wordpress media library failed for custom post type
- How are bulk actions handled in custom list table classes?
- Creating Settings Page with dropdowns for Plugin
- Empty POST data on server on AJAX request using Angular $http
- Custom Nav Menu items default to ‘menu-item-type’ => ‘custom’. How to make a “page” menu item?
- Can I get all options using the option group id? [closed]
- Actions or filters fired when data is saved in a custom table
- Implementing namespaces in plugin template
- Conditional add_filter?
- Calling apply_filters on non-documented hooks
- Commit changes to WordPress Plugin SVN with TortoiseSVN
- add_shortcode is not working [duplicate]
- How to get the post content after WordPress post processing?
- How to modify product page for Jigoshop
- Is @wordpress/env locked to node v14 or can I also use node v16?
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- What is the proper way to get logged in user id in a plugin?
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- Inserted double quote when prepending to the_content
- unable to wp_enqueue_script(‘suggest’);
- Plugin development – loading Javascript and Flash
- Update variable value via add_filter
- Plugin custom post template; without overriding all posts
- Run uninstall.php if a checkbox is checked from settings page
- Gravity Forms Anchor only on Front Page?
- Multiple page plugin settings
- sanitizing/escaping plugin options
- how to get the top 10 popular blogs
- script seem not load with use wp_enqueue_script
- Do I lose translations when I change my Text domain for my plugin on wp.org?
- Override woocommerce loop-start.php from theme using plugin?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- jQuery dependent script ignores $in_footer bool and doesn’t work in header
- Relational / Associate tables using native WordPress functionality
- Pull commentdata for pre_comment_on_post from comment_post_ID
- Page reload occurs before request finishes
- PHP Fatal error when using plugin_basename
- How to Rewrite WordPress URL for a Plugin
- Reading the inside of
- WordPress, GIT, Renamed Plugin Dir + files – Working Code now Broken [closed]
- WordPress plugin boilerplate AJAX functionality