if (isset($errormsg)) {echo $errormsg;} ?>
I'm not responsible of any file here. Download them at your own risk!
// w2box: web 2.0 File Repository v2.1 // (c) 2005, Clément Beffa // use it at your own risk $w2box_name = "your w2box"; $storage_dir = "data"; // storage directory (chmod 777) $max_filesize = 100 * pow(1024,2); // maximum filesize for this script (x MiB), update post_max_size & upload_max_filesize in php.ini for big size $allowed_fileext = array("gif","jpg","jpeg","png","pdf","txt","doc","rtf","zip");// allowed extensions $auth = true; //if true no authentication, everyone allowed to do everything. //to login as admin when everything is hidden, click on "Powered" (hidden link) in the footer!!! $admin_user = "admin"; $admin_pass = "admin"; $protect_upload = true; //allow only admin to upload $hide_upload = $protect_upload; //hide upload form if not admin $protect_delete = true; //allow only admin to delete $hide_delete = $protect_delete; //hide delete column if not admin //login authorize(true); //silent authorize first if (isset($_GET["admin"])) { authorize(); Header("Location: ".rooturl()); } //find real max_filesize $max_filesize = min(return_bytes(ini_get('post_max_size')),return_bytes(ini_get('upload_max_filesize')),$max_filesize); // deleting if (isset($_POST["delete"])) { if ($protect_delete) authorize(); deletefile($_POST["delete"]); } function deletefile($cell){ global $storage_dir; $cell=strip_tags($cell); $file=substr($cell,0,strlen($cell)-1); $file = "$storage_dir/".basename($file); if (!file_exists(utf8_decode($file))) echo "Error: file not found. ($file)"; else { $return = @unlink(utf8_decode($file)); if ($return) echo "successful"; else echo "Error: can't delete file."; } exit; } //uploading if (isset($_FILES['file'])) { if ($protect_upload) authorize(); uploadfile($_FILES['file']); } function uploadfile($file) { global $storage_dir, $max_filesize, $allowed_fileext, $errormsg; if ($file['error']!=0) { switch ($file['error']) { case 1: $errormsg = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; break; case 2: $errormsg = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form."; break; case 3: $errormsg = "The uploaded file was only partially uploaded."; break; case 4: $errormsg = "No file was uploaded."; break; case 6: $errormsg = "Missing a temporary folder."; break; } return; } $filesource=$file['tmp_name']; $filename=$file['name']; if (isset($_POST['filename']) && $_POST['filename']!="") $filename=$_POST['filename']; $filename=str_replace(" ","_",$filename); if (!in_array(strtolower(extname($filename)), $allowed_fileext)) $filename .= ".badext"; $filesize=$file['size']; if ($filesize > $max_filesize) { $errormsg = "File size is greater than the file size limit (".getfilesize($max_filesize).")."; return; } $filedest="$storage_dir/$filename"; if (file_exists($filedest)) { $errormsg = "$filename exists already in the storage directory."; return; } if (!copy($filesource,$filedest)) { $errormsg = "Unable to copy the file into the storage directory."; } if ($errormsg=="") { Header("Location: ".rooturl()); exit; } } //downloading if (isset($_GET['download'])) downloadfile($_GET['download']); function downloadfile($file){ global $storage_dir; $file = "$storage_dir/".basename($file); if (!is_file($file)) { return; } header("Content-Type: application/octet-stream"); header("Content-Size: ".filesize($file)); header("Content-Disposition: attachment; filename=\"".basename($file)."\""); header("Content-Length: ".filesize($file)); header("Content-transfer-encoding: binary"); @readfile($file); exit(0); } ?>
if (isset($errormsg)) {echo $errormsg;} ?>
I'm not responsible of any file here. Download them at your own risk!