当前位置: 代码迷 >> Java Web开发 >> input为file类型的 后台如何接收
  详细解决方案

input为file类型的 后台如何接收

热度:13   发布时间:2016-04-17 16:04:23.0
input为file类型的 后台怎么接收
<INPUT   type= "file "   id= "UploadFile "   NAME= "UploadFile "   Class= "cool2 "   size= "38   onChange= "setTimeout( 'checkimage() ',500) "   style= "border:1   solid   #999999 "   >

------解决方案--------------------
用SmartUpload,可以同时上传多个也可以写文本内容,
SmartUpload的用法你顺便搜下,很多
------解决方案--------------------
en , y一般都是用这种组件的, 不过你也可以自己写。inputstream 就是比较麻烦,而且不能同时传送文本
------解决方案--------------------
一般是用组件
------解决方案--------------------
用IO流接收
------解决方案--------------------
你的form 里面加上 "ENCTYPE= "multipart/form-data " ".如:
<FORM name= "uploadform " action= "Action.do " ENCTYPE= "multipart/form-data " method= "POST ">
------解决方案--------------------
在你的action里取得文件流,自己定义个form
FormFile file = (FormFile) Form.getImportFile();
通过file.getInputStream()取得文件流
  相关解决方案