Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class UploadController extends \Controller\Base {
- public static function single() {
- foreach ($_FILES as $file)
- {
- $filename = $file['name'][0];
- $destination = './' . $filename;
- print_r($file);
- foreach($file['tmp_name'] as $location) {
- if (move_uploaded_file($location, $destination))
- {
- // also insert the file into the database here
- }
- }
- }
- }
- public static function multi() {
- foreach ($_FILES as $file)
- {
- $filename = $file['name'];
- $destination = './' . $filename;
- //print_r($file);
- if (move_uploaded_file($file['tmp_name'], $destination))
- {
- // also insert the file into the database here
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement