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
- wp_http remote request not respecting timeout
- Sending JSON string through wp_remote_post()
- Filter any HTTP request URI?
- How to remove rest api link: in http headers?
- Creating directory in uploads – wp_mkdir_p() or WP_Filesystem?
- Standard location for plugin to save/cache files?
- How to use the HTTP API with a Proxy?
- Which filters or actions to use after a media upload and delete?
- Hook into WordPress update?
- Call to a member function put_contents() on a non-object
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- How to run multiple Async HTTP requests in WordPress?
- 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
- POST to a REST API from a wordpress form
- How to fix the error “file_get_contents was found in the file functions.php”?
- Can’t access wp_filesystem in cron function
- 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?
- Allowing all/different file type uploads
- Moving wp-content outside of web root?
- $wp_filesystem returns NULL. What are the dependencies?
- How do I edit the php/html for a particular post?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- Unable to access WP admin
- Use WP_Filesystem to list files in directory
- What’s a simple but secure method to get file contents into WordPress?
- 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]
- How to set charset for wp_remote_post request?
- Why cant the WP Filesystem API read googlefonts.json?
- Convert PHP readfile to WP_Filesystem
- Using wp_filesystem in Plugins to store customizer settings
- wp_remote_post with ssl:// protocol
- Where is Featured Image code stored in WP?
- how to change max file upload size WordPress 4.9.8 [closed]
- 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
- Inconsistent server code response using HTTP API
- using wp_remote_get to retrieve own url on local host
- Does WordPress’s HTTP API use any caching?
- Relative file paths in CSS when linking directly (not enqueuing)
- How to convert this cURL to wp_remote_get?
- Register visits of my pages in wordpresss
- Why my wordpress blog files are getting changed?
- Converting fopen/fwrite operations to WP_filesystem
- How to check if txt file exists inside template folder?
- How deactivate the http-api
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- How to make Http Request to a php file present in plugin directory of 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
- WP Remote Request not returning all of content via request
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- Why WordPress plugin url ajax doesn’t work?
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- Where to write custom logs in WordPress
- 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
- How does WordPress access theme and plugin files through its editor?
- why there is a large file named core in wpmu’s directory?