Skip to content

Commit e0cb6e6

Browse files
committed
Merge pull request #18 from mikelbring/develop
Created File::upload()
2 parents 0b7dbab + 6410e83 commit e0cb6e6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

system/file.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,15 @@ public static function download($path, $name = null)
186186
return $response;
187187
}
188188

189+
/**
190+
* Move uploaded file, Use $_FILES['file'] for $file
191+
*
192+
* @param array $file
193+
* @param string $path
194+
* @return bool
195+
*/
196+
public static function upload($file, $path)
197+
{
198+
return ( ! move_uploaded_file($file['tmp_name'], $path)) ? false : true;
199+
}
189200
}

0 commit comments

Comments
 (0)