33 lines
963 B
PHP
33 lines
963 B
PHP
<?php
|
|
// GLOBALS
|
|
global $ServerSecret;
|
|
$ServerSecret = 'e0VV7kkkYwK2';
|
|
|
|
// ARGS
|
|
if (!isset($_GET['UserID']) OR !isset($_GET['ClientSecret'])) {
|
|
return;
|
|
}
|
|
elseif ($_GET['ClientSecret'] != $GLOBALS['ServerSecret']) {
|
|
return;
|
|
}
|
|
else {
|
|
$UserID = $_GET['UserID'];
|
|
}
|
|
|
|
// VARS
|
|
$filepath = $_FILES["file"]["tmp_name"];
|
|
$OriginalFilename = $_FILES["file"]["name"];
|
|
#$UsernameDir = "/var/www/zino/pkrstarsbot/upload/$UserID";
|
|
$UsernameDir = "/home/pkrstarsbot/upload/$UserID";
|
|
|
|
// Make UserDir if not existent
|
|
if (!file_exists($UsernameDir)) {
|
|
mkdir($UsernameDir, 0755, true);
|
|
#chown($UsernameDir, 'pkrstarsbot');
|
|
}
|
|
|
|
// Move uploaded file to UserDir
|
|
move_uploaded_file($filepath, "$UsernameDir/$OriginalFilename");
|
|
#chgrp("$UsernameDir/$OriginalFilename","pkrstarsbot")
|
|
#chown("$UsernameDir/$OriginalFilename", 'pkrstarsbot');
|
|
?>
|