⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fileupload.php

📁 通达OA部分源代码
💻 PHP
字号:
<html>
<head>
<Title>Image Uploader</Title>
<?php
include_once'styles.php';
include_once "session.php";

if(!isset($_SESSION["sbbleads_userid"]) )
	die();
?>
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function checkFile(form1)
{
	if (form1.userfile.value == "")
	{
		alert("Please choose a file to upload");
		form1.userfile.focus();
		return (false);
	}
	if ( !form1.userfile.value.match(/(\.jpg|\.png|\.gif|\.bmp|\.jpeg)$/i) )
	{
		alert("Please upload .gif/.jpg/.jpeg/.bmp/.png files only");
		form1.userfile.focus();
		return (false);
	}
	return(true);
}

function submit_frm(frm)
{
	if(checkFile(frm))
	{
		frm.action="doupload.php?box=<?php echo $_REQUEST["box"]; ?>";
		frm.submit();
	}
}

</script>

</head>

<body>
<FORM ENCTYPE="multipart/form-data" METHOD=post ID=form1 NAME=form1 onSubmit="javscript:return checkFile(form1);"> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="titlestyle">&nbsp;Upload Image</td>
    </tr>
    <tr>
      <td class="onepxtable"><table width="100%" cellpadding="3" cellspacing="3" class="innertablestyle">
          <tr> 
      <td> <b><font size="3" color="#FFFFFF"><u></u></font></b> <table width="100%">
                <tr class="innertablestyle"> 
                  <td width="15" valign="top">1.</td>
                  <td width="470">To upload an image, click the 'Browse' button 
                    &amp; select the file, or type the path to the file in the 
                    'Text-box' below.</td>
                </tr>
                <tr class="innertablestyle"> 
                  <td width="15" valign="top">2.</td>
                  <td width="470">Then click 'Upload' button to complete the process.</td>
                </tr>
                <tr class="innertablestyle"> 
                  <td width="15" valign="top">3.</td>
                  <td width="470" valign="top"><font class="red">NOTE:</font> 
                    The file transfer can take from a few seconds to a few minutes 
                    depending on the size of the file. Please have patience while 
                    the file is being uploaded.</td>
                </tr>
                <tr class="innertablestyle"> 
                  <td width="15" valign="top">4.</td>
                  <td width="470"><font class="red">NOTE:</font> The file will 
                    be renamed if the file with the same name is already present</td>
                </tr>
              </table></TD>
    </TR>
    <TR> 
            <TD class="innertablestyle"><STRONG>Hit [Browse] button to find file 
              on your computer.</STRONG><BR></TD>
    </TR>
    <TR> 
            <TD class="innertablestyle"><strong>Image File</strong> 
              <INPUT NAME=userfile SIZE=30 TYPE=file   MaxFileSize="1000000"> 
        <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> </TD>
    </TR>
    <TR> 
            <TD class="innertablestyle" height="8"></TD>
    </TR>
    <TR> 
            <TD class="innertablestyle">
<input type="button" value="Upload" name="uploadfile" onClick="javascript:submit_frm(this.form);"></TD>
    </TR>
    <TR> 
            <TD class="innertablestyle"><font class="red">NOTE:</font> Please have<font color="#006699">&nbsp; 
              </font> patience, you will not receive any notification until the 
              file is completely transferred.<BR></TD>
    </TR>
  </table></td>
    </tr>
  </table>
  

</FORM>

   
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -