How can I save a file using curl and PHP?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- Illegal to have multiple roots (start tag in epilo
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
did you want something like this ?
Functionality: Its a function and accepts three parameters
$file
: is the filename of the object to be retrieved$local_path
: is the local path to the directory to store the object$newfilename
: is the new file name on the local systemI think curl has -o option to write the output to a file instead of stdout.
After -o you have to provide the name of the output file.
example:
You can use:
See: http://jp2.php.net/manual/en/function.curl-exec.php and http://us3.php.net/manual/en/function.fwrite.php