SoFunction
Updated on 2025-04-09

Scripts to establish file exchange function (II)

//
This is the interface for uploading files, which can be made very good with any editor. It should be noted that the table
ENCTYPE="multipart/form-data" section. This must not be wrong, otherwise the server will not know that you are uploading the file.
There is nothing else to say, hehe, everyone can make a better one.

<html>
<head>
<title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<FORM ENCTYPE="multipart/form-data" NAME=myform ACTION= METHOD="POST">  
  <table width="600" border="1" cellspacing="0" cellpadding="0" align="center" height="160" bgcolor="#E2E3FE" bordercolorlight="#006699" bordercolordark="#FFFFFF">
    <tr>  
      <td colspan="4" height="40">  
<div align="center">File Upload</div>
      </td>
    </tr>
    <tr>  
      <td width="80" height="40">  
<div align="center">Select upload file</div>
      </td>
      <td width="170" height="40">  
        <div align="left">  
          <input type="file" name="myfile">
        </div>
      </td>
      <td width="80" height="40">  
<div align="center">Select file type</div>
      </td>
      <td width="170" height="40">  
        <div align="left">  
          <select name="type" size="1">
<option value="notification" selected>notification</option>
<option value="Distribute File">Distribute File</option>
<option value="Report File">Report File</option>
          </select>
        </div>
      </td>
    </tr>
    <tr>  
      <td width="80" height="40">  
<div align="center">Uploader</div>
      </td>
      <td width="170" height="40">  
        <div align="left">  
          <input type="text" name="uploader" maxlength="20">
        </div>
      </td>
      <td height="40">  
<div align="center">Upload date</div>
        <div align="left"> </div>
      </td>
      <td height="40">  
        <input type="text" name="date" value="<? print(date("Y-n-j")); ?>">
      </td>
    </tr>
    <tr>  
      <td height="40">  
        <div align="center"></div>
        <div align="left"></div>
        <div align="center"></div>
<div align="center">File description </div>
      </td>
      <td colspan="3" height="40">
        <input type="text" name="fileshow" size="60">
      </td>
    </tr>
    <tr>  
      <td colspan="4" height="40">  
        <div align="center">  
<input type="submit" name="Submit" value="upload">
        </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>