Commit 144194f5 authored by mark burdett's avatar mark burdett
Browse files

return result of file save attempt

parent 989e58e3
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -796,10 +796,7 @@ function _mytube_add_param($url, $param, $embed) {
function _mytube_download($url, $destination, $preview = false) {
  $request = drupal_http_request($url);
  if ($request->code == 200) {
    $fp = fopen($destination, 'w');
    fwrite($fp, $request->data);
    fclose($fp);
    return true;
    return file_put_contents($destination, $request->data);
  }
  else {
    watchdog('mytube', 'Failed to download file. ' . $request->error);