5 require_once (
"$admLibrary/ck_aticket.i");
7 $dms_ok=array(
'action'=>
'string',
'upload_file_name'=>
'string');
10 $self =
"$PHP_SELF?ft={$ft}";
11 $saved_file =
"$home_path/public_html/statban.jpg";
15 case "Upload the File":
18 if (!is_uploaded_file($_FILES[
'upload_file'][
'tmp_name']) || ($_FILES[
'upload_file'][
'size'] < 1)) {
21 switch ($_FILES[
'upload_file'][
'error']) {
23 $up_err =
"0: No error, the file was uploaded successfully";
26 $up_err =
"1: The upload is larger than the amount allowable by the upload_max_filesize directive in the php.ini";
29 $up_err =
"2: The upload is larger than the MAX_FILE_SIZE directive that was specified via html";
32 $up_err =
"3: The file was only partially uploaded";
35 $up_err =
"4: no file was uploaded";
41 Upload File Error --\n 43 Client Filename: {$_FILES['upload_file']['name']}\n 44 Client Filesize: {$_FILES['upload_file']['size']}\n 45 Client Filetype: {$_FILES['upload_file']['type']}\n\n 46 Client IP: {$_SERVER['REMOTE_ADDR']}\n\n 47 Web Server Information \n 48 Temp File Name - {$_FILES['upload_file']['tmp_name']} 49 Error Reported - $up_err\n\n 53 # test image size for exact conformance with size - 55 $imgstats = getimagesize($_FILES[
'upload_file'][
'tmp_name']);
58 $imgT = $imgstats[
'mime'];
61 if ($imgW != 576 || $imgH != 115 || $imgT !=
"image/jpeg") {
62 $up_err =
"Error Reported - Image is wrong type or wrong size";
64 Upload File Error --\n 66 Client Filename: {$_FILES['upload_file']['name']}\n 67 Client Filesize: {$_FILES['upload_file']['size']}\n 68 Client Filetype: {$_FILES['upload_file']['type']}\n\n 69 Client IP: {$_SERVER['REMOTE_ADDR']}\n\n 70 Web Server Information \n 71 Temp File Name - {$_FILES['upload_file']['tmp_name']} 72 Error Reported - Image dimensions ( $imgW x $imgH ) are wrong.\n\n 81 $notify->line = __LINE__;
82 $notify->file = __FILE__;
83 $notify->callingfunction = __FUNCTION__;
87 $notify->mailto =
"mark@homecu.net";
95 There was an error uploading the file <b>{$_FILES[
'upload_file'][
'name']}</b>.<br>
96 The error reported was: <b>$up_err</b>.<br>
97 Please retry uploading the file.<br>
98 If the problem persists call DMS and report the problem.
104 $find_ary = array(
"\\",
"/",
" ",
";");
105 $rpl_ary = array(
"",
"",
"",
"");
107 $real_name = str_replace($find_ary, $rpl_ary, $_FILES[
'upload_file'][
'name']);
110 if (!move_uploaded_file($_FILES[
'upload_file'][
'tmp_name'], $saved_file)) {
111 unlink ($_FILES[
'upload_file'][
'tmp_name']);
115 Uh-oh, couldn
't post the file where it belongs. Not sure what happened. Better call DMS. 118 // File was moved change the mod settings 119 $rc = @chmod($saved_file, 0644); 121 // Print the page text 124 Thank you for the upload.<br> 125 The file <b>{$_FILES['upload_file
']['name
']}</b> with a size of <b>{$_FILES['upload_file
']['size
']}</b> bytes was successfully uploaded. 132 // Print the form for uploading 133 // This is the default, which is to print the multi-part form for uploading 135 $print_msg = <<< set_msg 136 <tr><td colspan="2"><font color='red
'>$msg</font></td></tr> 143 <form method="post" action="$self" enctype="multipart/form-data"> 145 <table cellpadding="4" align="CENTER" cellspacing="0" border="0" class="dtl"> 147 <tr><th align="CENTER" colspan="2" class="bar">$Cu Statement Banner Upload</th></tr> 148 <tr><td>Choose a File:</td> <td><input type="file" name="upload_file" size="36" onChange="copyFile()"></td></tr> 149 <input type="hidden" name="upload_file_name" value=""> 150 <tr><td align="CENTER" colspan="2"><input type="submit" name="action" value="Upload the File" onClick="return val_period();"></td></tr> 154 <script language="javascript"> 156 function copyFile() { 157 document.forms[0].upload_file_name.value = document.forms[0].upload_file.value;