Bootstrap templates
- event mockup - login page
This commit is contained in:
27
bootstrapTemplates/perfectum_dashboard_1_0_5/misc/uploadify.php
Executable file
27
bootstrapTemplates/perfectum_dashboard_1_0_5/misc/uploadify.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
Uploadify
|
||||
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
|
||||
Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
// Define a destination
|
||||
$targetFolder = '/uploads'; // Relative to the root
|
||||
|
||||
if (!empty($_FILES)) {
|
||||
$tempFile = $_FILES['Filedata']['tmp_name'];
|
||||
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
|
||||
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
|
||||
|
||||
// Validate the file type
|
||||
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
|
||||
$fileParts = pathinfo($_FILES['Filedata']['name']);
|
||||
|
||||
if (in_array($fileParts['extension'],$fileTypes)) {
|
||||
//move_uploaded_file($tempFile,$targetFile);
|
||||
echo '1';
|
||||
} else {
|
||||
echo 'Invalid file type.';
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user