然後用apache實現文件上載功能

在apache官網的commons裏面有實現庫
Commons FileUpload

The Commons FileUpload package makes it easy to add        robust, high-performance, file upload capability to your servlets and        web applications.

FileUpload parses HTTP requests which conform to        RFC 1867,        "Form-based File Upload in HTML". That is, if an HTTP request is        submitted using the POST method, and with a content type of        "multipart/form-data", then FileUpload can parse that request, and        make the results available in a manner easily used by the caller.

Starting with version 1.3, FileUpload handles        RFC 2047 encoded header values.

The simplest way to send a multipart/form-data request to a server is via a web form, i.e.


<form method="POST" enctype="multipart/form-data" action="fup.cgi">
  File to upload: <input type="file" name="upfile"><br/>
  Notes about the file: <input type="text" name="note"><br/>
  <br/>
  <input type="submit" value="Press"> to upload the file!
</form>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章