protected function createFromUrl($file)
	{
		$ch = curl_init ($file);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$rawFile = curl_exec($ch);
		curl_close ($ch);

		// Get the original name of the file
		$ori_name = pathinfo($file);
		$name = $ori_name['basename'];
		
		// Create a filepath for the file by storing it on disk.
		$filePath = sys_get_temp_dir() . "/$name";
		file_put_contents($filePath, $rawFile);

		return new File($filePath);
	}
protected function createFromUrl($file)
	{
		$ch = curl_init ($file);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$rawFile = curl_exec($ch);
		curl_close ($ch);

		// Get the original name of the file
		$ori_name = pathinfo($file);
		$name = $ori_name['basename'];
		
		// Create a filepath for the file by storing it on disk.
		$filePath = sys_get_temp_dir() . "/$name";
		file_put_contents($filePath, $rawFile);

		return new File($filePath);
	}
protected function createFromUrl ( $ file ) { $ ch = curl_init ( $ file ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 0 ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; $ rawFile = curl_exec ( $ ch ) ; curl_close ( $ ch ) ; // Get the original name of the file $ ori_name = pathinfo ( $ file ) ; $ name = $ ori_name [ 'basename' ] ; // Create a filepath for the file by storing it on disk. $ filePath = sys_get_temp_dir ( ) . "/$name" ; file_put_contents ( $ filePath , $ rawFile ) ; return new File ( $ filePath ) ; }
Fetch a remote file using a string URL and convert it into
an instance of Expstudio\LaraClip\File\File.

@param  string $file
@return Expstudio\LaraClip\File\File
Fetch a remote file using a string URL and convert it into an instance of Expstudio \ LaraClip \ File \ File .