当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到值!

fytwangyang 2008-07-28 04:33:39
百度一下,找到个答案,看不太懂,请高人解释一下:
1. download > http://jakarta.apache.org/commons/sandbox/fileupload/>
2. invoke readHeaders() in > org.apache.commons.fileupload.MultipartStreamThe Solution B as given by my dear friend is a bit hectic and a bit complex :(We can try the following solution which I found much simpler (at least in usage).

1. Download one of the versions of UploadFile from http://jakarta.apache.org/commons/fileupload/

2. Invoke parseRequest(request) on org.apache.commons.fileupload.FileUploadBase which returns list of org.apache.commons.fileupload.FileItem objects.

3. Invoke isFormField() on each of the FileItem objects. This determines whether the file item is a form paramater or stream of uploaded file.

4. Invoke getFieldName() to get parameter name and getString() to get parameter value on FileItem if it's a form parameter. Invoke write(java.io.File) on FileItem to save the uploaded file stream to a file if the FileItem is not a form parameter.
那位高人给解释一下具体怎么做,特别是invoke 什么的 就是汉语我也不太明白,所以请具体点 :)
...全文
78 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fytwangyang 2008-07-28
  • 打赏
  • 举报
回复
能具体解释下 怎么做吗比如 第三步
阿云ivan 2008-07-28
  • 打赏
  • 举报
回复
invoke 就是调用的意思

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧