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?
- Images stored from external API not loading
- Can’t save Image from external API into Database
- 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
- Multimedia upload error in my wordpress job board plugin
- WordPress Plugin Authoring question about jquery and css
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- Adding Permalink to Slides with ‘Simple Nivo Slider’ plugin?
- Loading Images from Javascript on the Front End
- How to add a new taxonomy link to the admin menu
- Many Single Sites, One Plugin directory – adjust plugins_url()
- insufficient permissions; coding an action for plugin governed by custom capability
- wp_insert_post generated mixed permalinks
- Adjust query on single
- How to call function from another plugin?
- Get coordinates of selected area to use in image maps [closed]
- Plugin won’t activate
- Adding tables to dashboard pages programmatically?
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- How to exclude categories from get_categories() select list inside a widget admin panel
- Setting a post’s category
- Plugin access to average users not only admin
- Setting post_id for single.php based on URL without a redirect
- WP 3.3 makes it possible to add meta box to Category Editor Screen?
- How to automatically activate a plugin on install
- disable defaault wordpress comments from a plugin
- using admin functions on frontend
- Widget internal hooks and functions
- Javascript Function Called Too Early in PHP Script
- Pause plugin option page until all data manipulation is complete
- How to display TinyMCE HTML view?
- WordPress plugin advice: suggestions for writing a plugin the correct way
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Why doesn’t my Table get created?
- Modify code for functions.php with specific twitter user url and hashtags
- Need Help Determining Where Header Error is Happening
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- can members have multiple registration using the same password?