Advertisement
Sajgoniarz

Untitled

May 27th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. public static function saveFile($file){
  2.         $root = $_SERVER['DOCUMENT_ROOT'];
  3.         $fileName = $file->getClientFilename();
  4.         $destination = realpath("$root/img/uploaded/full/$fileName");
  5.         try {
  6.             $file->moveTo($destination);
  7.             return $destination;
  8.          } catch (\Exception $e){
  9.             return $e;
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement