Created
February 7, 2012 17:31
-
-
Save micahwave/1760851 to your computer and use it in GitHub Desktop.
ooyala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('sanitize_file_name', array(&$this, 'add_extension' ) ); | |
// Download file to temp location | |
$tmp = download_url( $url ); | |
remove_filter('sanitize_file_name', array(&$this, 'add_extension' ) ); | |
preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $tmp, $matches); | |
$file_array['name'] = basename($matches[0]); | |
$file_array['tmp_name'] = $tmp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment