我上传文件时用的是MultiPart(网上down的),可以分出是否是文件,然后对不是文件的部分可以得到它的值.我是自己将这个文件改造成一个javabean用的.可以在网上搜一下,挺好用,还有源码,实在没有可以给我发信[email protected]

解决方案 »

  1.   

    给我发一个吧,我看完后能满足我的条件一定给分,东北人,你还不相信?[email protected]
      

  2.   

    http://www.jspsmart.com/
    down一个smartupload下来。我刚刚用它做了一个基于JAVA的上传程序,挺好用的。
      

  3.   

    是这样的:如果同一个form表单里即有其他文本字段,又有上传的文件的输入框,那么form提交后server得到的数据流中都用Content-Disposition来区分不同的参数,只是内容不同而已。比如我有如下一个form:<html>
    <head><title>Servlet1</title></head>
    <body>
    <form ENCTYPE="multipart/form-data" method=post action=''>
    <input type=file enctype="multipart/form-data" name=filedata>
    <input type=submit>
    <input type=hidden name=SuccessPage value=http://localhost/index.html>
    </form>
    </body>
    </html>我上传一个文件名字叫c:\test.txt,内容是:This is a test.
    那么上传后得到的数据流就为:Content-Disposition: form-data; name="filedata"; filename="C:\test.txt"
    Content-Type: text/plainThis is a test.Content-Disposition: form-data; name="SuccessPage"http://localhost/index.html所以你还是需要得到上传的参数名,然后取不同的Content-Disposition段落。希望对你有所帮助。