Check out download_url()
– it’s only loaded in the admin, so you’ll have to include it (or write your own) if needed on the front-end.
From download_url()
you can use:
$response = wp_remote_get(
TCS_CPDF_REMOTE_ZIP,
array(
'timeout' => 300,
'stream' => true,
'filename' => TCS_CPDF_LOCAL_ZIP
)
);
Related Posts:
- How to control accept encoding on HTTP API requests?
- How do I mock HTTP requests for PHPUnit?
- Mutual Authentiction on HTTPS with WordPress HTTP API?
- HTTP digest authentication using wp_remote_get
- Error timed out with succesfull wp_remote_post
- Difference between wp_remote_post and wp_safe_remote_post
- How to consume and display external data in WordPress from another website
- cURL vs WP_Http for safety?
- Posting an XML request using HTTP API
- Is it possible to process $_POST / inbound http request in way to automatically create WordPress post?
- What’s the best way to detect referrer?
- Behind-the-scenes HTTP Request?
- Sending JSON Payload using Request::request_multiple()
- wp remote post getting a 404 error code
- wp_remote_request header error even though working properly with cURL
- Proper context for wp_remote_post()
- How to add code to HTTP header
- Using WP_Http to post data to Webservice without blocking caller script
- Filter any HTTP request URI?
- Creating directory in uploads – wp_mkdir_p() or WP_Filesystem?
- WP_Http_Cookie destroys cookie value through urldecode()
- Convenient way to use wp_filesystem
- Copy and delete a directory with WordPress functions
- parse XML from URL (via SOAP)
- Copy a file from a plugin into my theme directory
- How to fix the error “file_get_contents was found in the file functions.php”?
- What exactly does $wp_filesystem->abspath() return?
- How do you use unzip_file()?
- Connect external web app to wordpress
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Moving wp-content outside of web root?
- $wp_filesystem returns NULL. What are the dependencies?
- Unable to access WP admin
- Use WP_Filesystem to list files in directory
- API JSON Data in WordPress
- Storing an XML Response (Transient)?
- How do I get URL from WP_HTTP object?
- What is the official way to consume the WordPress API? (api.wordpress.org)
- Allow download_url for lan addresses
- How to append_contents using WP_Filesystem?
- How to duplicate a curl XML request using HTTP API?
- When to use the Filesystem API? Should I use it at all?
- What to use , set_transient, set_option or file system? [closed]
- Why cant the WP Filesystem API read googlefonts.json?
- Convert PHP readfile to WP_Filesystem
- wp_remote_post with ssl:// protocol
- Downloading File from Outside Web Root
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Extending WordPress REST API
- Creating directory and file using native wordpress file system
- Does WordPress’s HTTP API use any caching?
- How to convert this cURL to wp_remote_get?
- Register visits of my pages in wordpresss
- Why my wordpress blog files are getting changed?
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- Cache WP remote_get HTTP Response using Transients
- Finding the path of a specific WordPress install
- Return WP_Error as WP_REST_Response
- How to include form for WP_Filesystem()?
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- Why WordPress plugin url ajax doesn’t work?
- wp_filesystem put_contents issue with owner/group
- How to make a implement queue for scheduling tasks in WordPress?
- XML-code sent via the POST method to the URL (API) [closed]
- Copy Folder to another Folder using WP Filesystem
- How do I create an rssfeed from the contents on this page?
- WP http XML response HTML encoding and image display problems
- why there is a large file named core in wpmu’s directory?
- Save external API calls in WordPress
- Running rmdir function on post save
- http_response_timeout filter not working
- Add information to HTTP Header in WordPress Plugin
- wp_remote_post empty $_POST
- Why does WP HTTP API switch the method (POST/PURGE) to GET when redirecting (302)?
- How to set a header in wp_safe_remote_get()?
- Is there a way to use WP filesystem without credentials when FS_METHOD is NOT set to direct?
- WP_Filesystem in custom customize control
- Upload PDF and other files from the Front-End
- Need help creating asynchronous data scraper in WordPress
- Get the name WordPress default theme in the core
- HTTP API CALLS issue on Woocommerce WordPress
- How to prevent users to view server files using WP File Manager plugin?
- Submitting form from input[type=file] dialog box
- How do you find a file in the media library using the file URL?
- How to Copy Upload Image using WP_Filesystem_Direct
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- How to upload .tex files in wordpress?
- Need folder for CPT templates for eg: single-{post_type}.php
- Media Upload to custom database and Custom Directory
- Creating custom URLs with template to fetch external JSON
- Why does unzip_file always return true but nothing happens?
- Error Copying Directory On Plugin Activation
- Turn twitter-urls into list timelines?
- Get full page HTML for a non-public WordPress page
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- Download a zip folder of selected files
- How to use the HTTP API (wp_remote_get) instead of cURL?
- WordPress upload path decalration
- Why is this specific API request failing when sending via wp_remote_post?
- Does unzip_file() over-write by default?