Something like this, perhaps.
$args['body'] = array('post_file'=>'@/path/FILE.EXT');
wp_remote_post($url, $args);
The $args array contains the parameters for the post. The body parameter controls what is posted. There’s many other possible parameters as well. See http://codex.wordpress.org/HTTP_API#Other_Arguments
Note that the @file method may be specific to curl, and might not work with the other possible HTTP transports that WP supports.
Related Posts:
- Re use authenticated HTTP connection or cUrl handle
- Build dynamic page from cURL (HTML page) response with plugin
- How to convert this cURL to wp_remote_get?
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- Update File Once Every 30 Days
- Simulating timeout is not working
- WP Refused to display ‘URL’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
- Is it possible to make WordPress as a RESTful app?
- WordPress Plugin Development – Headers Already Sent Message
- Get page content using slug
- How to include wp-load.php from any location?
- Correct way to enqueue jquery-ui
- How to echo the_excerpt without the P tag wrapper?
- How can I update a wordpress plugin from a Git repository (github)
- Is There a Plugin Life Cycle Documentation?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- How to disable plugin update notification for a specific plugin in Multisite
- Shortcode adding p and br tags
- Building a better media uploader for WordPress
- Problems with localization
- Install and load additional plugins when running unit tests
- Having Problem On Getting WP Post Gallery Images URL
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- How to get current page id through the plugin
- Properly licensing a plugin that uses Apache 2.0 licensed code
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- Can I dynamically create a link to my plugin settings/options page from my plugin description?
- Saving data from block editor to the database
- Cannot search post by taxonomy
- OOP Plugin and Menu – Call to undefined function register_setting()
- Will current_theme_supports return TRUE with a nonstandard add_theme_support?
- WP AJAX is not working, always returns 0
- Act on user meta updated, but only once
- get_pages Drop down list for selection of a page
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Display content from custom post without modifying the single template
- How do I add custom column to woocommerce cart?
- WordPress mode for emacs?
- Widget translation on my plugin
- TinyMCE 4.7.11 custom styles using styleselect – what does the ‘attributes’ argument do?
- Modifying meta tags after doing ajax call in plugin
- Modifying the default WordPress .htaccess with a plugin
- How to schedule a cron job in plugin without waiting for page load request?
- Is there a way to list all actions registered by a plugin or theme?
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- Call wp_generate_password() from within a Class
- Set different custom menu items for different user roles
- Getting List of all registered Dashboard Widgets
- Why does wp_remote_post returns an empty body response on certain endpoints?
- Replace youtube embed in wordpress
- Where to write custom logs in WordPress
- How developed with version control word press site on shared host? [closed]
- Admin – Handle data before creating or updating a post, page or custom post
- 3rd Party Plugin dependency – how to correctly load classes
- add_settings_field Data not passing to Options Page Like it should
- Valid filenames for add_action’s first parameter
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Can’t get CSS Into the Head via add_action
- Correct syntax for database inserts from plugin?
- wp_schedule_event() set daily, but processed every second
- Empty Pdf file generated with FPDF library in WordPress plugin [closed]
- $wpdb->update() always need a second try
- Why aren’t some plugin styles loading when I load a template?
- Pagination not working with custom wp_query
- My plugin won’t create table in wordpress 3.5
- Remove Permalink Meta Box not working?
- WordPress actions for plugin admin UI page
- wp_insert_user keeps echoing values
- Pause plugin option page until all data manipulation is complete
- Modify custom block plugin without losing content
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- apply_filters() and call_user_func() to define and call a function outside a class
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- howTo let wordpress endpoint return html-page
- Sanitization and validation input fields – Settings API
- User meta query using Wildcard
- Warning: Illegal string offset ‘Andorra’ in … on line 106
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Different style for specific rows in custom list table using WP_List_Table
- wordpress4.8.2 Multilingual Plugin
- Dedicated server and WPDB Class : huge slow-down of the website
- How to show metabox just in post.php in admin?
- $wpdb how can i save my postmeta table before querying it
- Create dedicated page with custom template showing custom data
- How can I see a varibles value when my plugin runs?
- Can’t switch theme after activation
- WordPress plugin: admin-ajax.php not passing data to custom function
- How do I replace title with my plugin?
- Create pages for authors
- How do I create Widget within plugin that uses its own class?
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- How can I dynamically change title and description in WordPress?
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Is it within WordPress guidelines to update another plugin’s database fields from my own plugin? [closed]
- Block Development: hamburger module throwing error in save function
- How can I chanage the user for the composer container in wp-env?
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?