관리-도구
편집 파일: upload_form.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .style3 {font-size: 24px; font-family: Georgia, "Times New Roman", Times, serif;} --> </style> <Script language="JavaScript" type="text/javascript"> //var exts = "jpg|gif|png|bmp|mp3|mpg|mpeg|avi|rar|zip|7z|gz|txt|avi|mpg"; var exts = ".*"; //Use this to accept all Extensions function StartUpload(f1) { if(f1.file_1.value=="") { alert('Select at least one file to upload'); return false; }; if(!checkExt(f1.file_1.value))return false; alert("Please be Patient - we are uploading your file."); document.getElementById('btn_upload').value = "Processing...."; var UID = Math.round(10000*Math.random())+'0'+Math.round(10000*Math.random()); f1.action = f1.action.split('?')[0]+'?upload_id='+UID; if(f1.popup.checked) { win1 = window.open(f1.action.split('upload.cgi')[0]+'upload_status.cgi?upload_id='+UID,'win1','width=320,height=240,resizable=1'); win1.window.focus(); } return true; } function checkExt(value) { if(value=="")return true; var re = new RegExp("^.+\.("+exts+")$","i"); if(!re.test(value)) { alert("This file extension is not allowed: \n" + value + "\n\nOnly these extensions are allowed: "+exts.replace(/\|/g,',')+" \n\n"); return false; } return true; } </Script> </head> <body> <form enctype="multipart/form-data" action="/cgi-bin/upload.cgi?upload_id=" method="post" onSubmit="return StartUpload(this);" target="xupload"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999"> <tr> <td><table width="100%" border="0" cellspacing="1" cellpadding="4"> <tr> <td height="48" colspan="2" align="center" valign="middle" bgcolor="#F0F0F0" class="style3">Upload File.... </td> </tr> <tr> <td width="40%" align="right" valign="top" bgcolor="#F9F9F9"><span class="style1">Select File to Upload : </span></td> <td width="60%" align="left" valign="top" bgcolor="#FFFFFF"><input name="file_1" type="file" onChange="checkExt(this.value)"></td> </tr> <tr> <td align="right" valign="top" bgcolor="#F9F9F9" class="style1">Comment with File : </td> <td align="left" valign="top" bgcolor="#FFFFFF"><input name="Comment" type="text" id="Comment" size="25" value="" /></td> </tr> <tr> <td colspan="2" align="middle" valign="top" bgcolor="#F9F9F9" class="style1"><input type="submit" id="btn_upload" value="Upload File"></td> </tr> <tr> <td height="41" colspan="2" align="center" valign="middle" bgcolor="#F0F0F0"><iframe src="about:blank" name="xupload" style="position:absolute;left:-9999px;"></iframe> </td> </tr> </table></td> </tr> </table> </form> </body> </html>