This blob has been accessed 406 times via Git panel.
- <?php
- session_start();
- if (!isset($_SESSION['logged_uid']) or !isset($_SESSION['logged_lvl']) or !isset($_SESSION['logged_key']) or ($_SESSION['logged_lvl'] != "subscriber")) {
- exit;
- }
- /*
- $server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
- $server_post_max_size = return_bytes(ini_get('post_max_size'));
- $server_memory_limit = return_bytes(ini_get('memory_limit'));
- $max_file_size = $server_upload_max_filesize;
- if ($server_upload_max_filesize > $server_post_max_size) {
- $max_file_size = $server_post_max_size;
- }
- if ($server_post_max_size > $server_memory_limit) {
- $max_file_size = $server_memory_limit;
- }
- */
- if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
- if (is_uploaded_file($_FILES['filedrop_obj']['tmp_name'])) {
- //if ($_FILES['filedrop_obj']['size'] <= $max_file_size) {
- $filedrop_dir = sha1($_SESSION['logged_uid']);
- $filedrop_box = $_POST['filedrop_box'];
- $filedrop_nom = str_replace(" ", "_", $_FILES['filedrop_obj']['name']);
- if (!file_exists(".tmp/$filedrop_dir/$filedrop_box")) {
- mkdir(".tmp/$filedrop_dir/$filedrop_box",0700,1);
- }
- if (!file_exists(".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom")) {
- $res = copy($_FILES['filedrop_obj']['tmp_name'], ".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom");
- unlink($_FILES['filedrop_obj']['tmp_name']);
- echo "<script>alert(\"{$_FILES['filedrop_obj']['name']} saved as $filedrop_nom\");</script>";
- }
- else {
- unlink($_FILES['filedrop_obj']['tmp_name']);
- }
- //}
- //else {
- // unlink($_FILES['filedrop_obj']['tmp_name']);
- //}
- }
- else {
- unlink($_FILES['filedrop_obj']['tmp_name']);
- }
- }
- ?>