fix
This commit is contained in:
@@ -232,10 +232,22 @@ class Member extends Member_Controller {
|
||||
$fileType = $_FILES['uploadedFile']['type'];
|
||||
$fileNameCmps = explode(".", $fileName);
|
||||
$fileExtension = strtolower(end($fileNameCmps));
|
||||
|
||||
|
||||
$newFileName = md5(time() . $fileName) . '.' . $fileExtension;
|
||||
$allowedfileExtensions = array('jpg', 'gif', 'png', 'zip', 'txt', 'xls', 'doc', 'mp4');
|
||||
if (in_array($fileExtension, $allowedfileExtensions)) {
|
||||
|
||||
// directory in which the uploaded file will be moved
|
||||
$uploadFileDir = '/home/uploads/';
|
||||
$dest_path = $uploadFileDir . $newFileName;
|
||||
|
||||
if (move_uploaded_file($fileTmpPath, $dest_path)) {
|
||||
$message = 'File is successfully uploaded.';
|
||||
} else {
|
||||
$message = 'There was some error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
|
||||
}
|
||||
}
|
||||
print_r($_FILES);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user