$maxfilesize) stderr("Upload failed", "Sorry, that file is too large for the bit-bucket."); $filename = $file["name"]; if (strpos($filename, "..") !== false || strpos($filename, "/") !== false) stderr("Upload failed", "Bad file name."); $tgtfile = "bitbucket/$filename"; if (file_exists($tgtfile)) stderr("Upload failed", "Sorry, a file with the name " . htmlspecialchars($filename) . " already exists in the bit-bucket."); $i = strrpos($filename, "."); if ($i !== false) { $ext = strtolower(substr($filename, $i)); if (($it == IMAGETYPE_GIF && $ext != ".gif") || ($it == IMAGETYPE_JPEG && $ext != ".jpg") || ($it == IMAGETYPE_PNG && $ext != ".png")) stderr( _("Error"), "Invalid file name extension: ".htmlspecialchars($ext).""); } else stderr( _("Error"), "File name needs an extension."); move_uploaded_file($file["tmp_name"], $tgtfile); $url = str_replace(" ", "%20", htmlspecialchars($GLOBALS['DEFAULTBASEURL']."/bitbucket/$filename")); stderr("Success", "Use the following URL to access the file: $url

Upload another file."); } stdhead("Bit-bucket upload"); ?>

Bit-bucket upload

Maximum file size: 250,000 bytes.

Upload file

Disclaimer: Do not upload unauthorized or illegal pictures. Uploaded pictures should be considered "public domain"; do not upload pictures you wouldn't want a stranger to have access to.