upload.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:3k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: upload.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.7 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - File uploading test interface (administration interface)
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- // default do
- ############################### CREATE SPAM FILTER ###############################
- if ($_REQUEST['do'] == "uploadtest") { // Perform the test
- // We need all warnings and notices here, even non-fatal ones
- error_reporting(E_ALL);
- $tmpname = tempnam('/tmp/', 'dp2');
- if (move_uploaded_file($_FILES['attachment']['tmp_name'], $tmpname)) {
- $file = fopen($tmpname, 'rb');
- if ($file) {
- header('Content-Type: application/download; name=' . basename($tmpname));
- header('Content-Disposition: attachment; filename="' . $_FILES['attachment']['name'] . '"');
- header('Content-Length: ' . filesize($tmpname));
- fpassthru($file);
- } else {
- admin_header('File Upload Test', 'Test Failed');
- echo "Couldn't process $tmpname; attachment upload failed.";
- admin_footer();
- }
- unlink($tmpname);
- } else {
- admin_header('File Upload Test', 'Test Failed');
- echo "The upload failed. Check above for errors and/or warnings.";
- admin_footer();
- }
- } else { // Show the upload test form
- admin_header('File Upload Test');
- ?>
- Use this page to test DeskPRO's ability to receive uploaded files via your
- web server. Submit a file with the form below (it should be small, but can
- be of any type). When you submit the form, the server will attempt to send
- it back to your browser as a downloadable file. Save it with a new name,
- and compare it to the file you uploaded. The two should be identical in
- size and content. If this is true, file uploading is working properly. If
- not, or if you see an error message instead of a "Save As..." prompt, your
- server cannot properly handle file uploads.</P>
- <FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="upload.php">
- <INPUT TYPE="hidden" NAME="do" VALUE="uploadtest" />
- <INPUT TYPE="file" NAME="attachment"><BR>
- <INPUT TYPE="submit" NAME="uploadtest_submit" VALUE="Upload Test">
- </FORM>
- <?
- }
-
- admin_footer();
- ?>