Thread: cURL - m4v
View Single Post
Old 10-01-2009, 10:50 AM   #1 (permalink)
russellharrower
The Contributor
 
russellharrower's Avatar
 
Join Date: Jul 2009
Posts: 80
Thanks: 13
russellharrower is on a distinguished road
Default cURL - m4v

Hi i am using the following code to transfer files that start with m4v, however they are not copying over. i was wondering if cURL is able to copy these files?

PHP Code:
<?php
/**
* Initialize the cURL session
*/
$ch curl_init();
/**
* Set the URL of the page or file to download.
*/


$filename 'http://example.com/file.m4v';

$finfo explode('.',$filename);
$fileSuffix array_pop($finfo);

curl_setopt($chCURLOPT_URL$filename);
/**
* Create a new file
*/

$fp fopen('r.'.$fileSuffix'w');
/**
* Ask cURL to write the contents to a file
*/

curl_setopt($chCURLOPT_FILE$fp);
/**
* Execute the cURL session
*/

curl_exec ($ch);
/**
* Close cURL session and file
*/

curl_close ($ch);

fclose($fp);

print 
'<a href="r.'.$fileSuffix.'"/>';
?>
russellharrower is offline  
Reply With Quote