public class FileUploaderBase
extends javax.servlet.http.HttpServlet
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
configPath
The config path.
|
protected String |
dirName
The dir name.
|
protected String |
dirTemp
The dir temp.
|
protected HashMap<String,String> |
extMap
The ext map.
|
protected long |
maxSize
The max size.
|
| 构造器和说明 |
|---|
FileUploaderBase() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected String |
getExtension(org.apache.commons.fileupload.FileItem item)
文档扩展名.
|
protected String |
getFileName(org.apache.commons.fileupload.FileItem item)
获取文件名.
|
protected String |
getSaveFileName(org.apache.commons.fileupload.FileItem item)
获取保存到服务上文件名.
|
void |
init() |
void |
processFileUpload(javax.servlet.http.HttpServletRequest request,
PrintWriter out)
处理上传文件.
|
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceprotected long maxSize
protected String configPath
protected String dirTemp
protected String dirName
public void init()
throws javax.servlet.ServletException
init 在类中 javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected String getExtension(org.apache.commons.fileupload.FileItem item)
item - the itemprotected String getFileName(org.apache.commons.fileupload.FileItem item)
item - the itemprotected String getSaveFileName(org.apache.commons.fileupload.FileItem item)
item - the itempublic void processFileUpload(javax.servlet.http.HttpServletRequest request,
PrintWriter out)
throws javax.servlet.ServletException,
IOException
request - the requestout - the outjavax.servlet.ServletException - the servlet exceptionIOException - Signals that an I/O exception has occurred.public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doPost 在类中 javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2017. All rights reserved.