mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
The New Desing
This commit is contained in:
parent
def9cc4ea6
commit
067a2c862a
305 changed files with 22231 additions and 7576 deletions
25
web/file_manager/upload_file.php
Normal file
25
web/file_manager/upload_file.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
// Define a destination
|
||||
$targetFolder = '/home/admin/'; // Relative to the root
|
||||
|
||||
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
|
||||
|
||||
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
|
||||
$tempFile = $_FILES['Filedata']['tmp_name'];
|
||||
$targetPath = $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.';
|
||||
// }
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue