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
- wp media uploader and ID3 tags
- WordPress Playground and uploading permission issue
- Do uploaded files to /tmp/ get deleted in WordPress automatically?
- How to modify the uploads directory for wp.media.frame assigning an subfolder name
- WordPress Media Uploader not displaying image that has just been uploaded
- How to override existing plugin action with new action
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- Where to enqueue stylesheets for plugin?
- How can the tinyMCE dom be manipulated (offical API does not seem to work)?
- Deletion of shared options using uninstall.php
- Plugin Settings not Saving on Ajax re-ordered table
- Undefined function wp_set_password
- How to modify the new WordPress 4.5 link inline toolbar
- Prevent plugin from deleting important directories
- Default category got deleted. How to get it back as ID=1?
- What allows a template file from plugin to be copied in child theme and overridden?
- How to set “Site Address (URL)” programmatically on WP multisite?
- creating custom archive template within plugin for custom post type using archive_template filter
- What is the proper method of using global $post?
- how to add stylesheet to particular plugin only?
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- Can I add custom css to an mu-plugin?
- insert query on a custom table using ajax with jQuery plugin Jeditable
- WordPress Rest API with rest_do_request, possible race condition?
- Is it possible to use WP-CLI in a plugin (or theme)?
- Load php file with jquery in single.php
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- WP 3-way voting system: On to something! Please help!
- Why is the expected file not being deleted?
- Custom non-template page on front end fails to render
- Add custom parameter for custom user role
- Post is uncatagorized in publish_post action
- Code to add template to page
- Navigate to external link if last page or post in a category
- How do I control the list of Pages an author can see?
- How to work with AJAX and WordPress?
- How to Register/Link to .js Files in WordPress Dynamicaly in Header.php
- Add Page With Parent ID
- Install a MU plugin from within another plugin
- `post_updated_messages` filter