使用jspSmartUpload上传文件,提示已经上传了,为什么就是找不到呢?
代码:(使用Eclipse for J2EE开发环境) FileUpload.html
<html> <head> <title>File Upload</title> </head> <body> <form name = "form1" method = "post" action = "upload.jsp" enctype = "multipart/form-data"> <input type = "file" name = "file1" size = "50"/><br> <input type = "submit" value = "submit"/> </form> </body> </html> upload.jsp: <%@ page language="java" import = "com.jspsmart.upload.*" contentType="text/html; charset=GBK"%> <html> <head> <title>Upload JSP</title> </head> <body> <% SmartUpload mySmartUpload = new SmartUpload(); int count = 0; mySmartUpload.initialize(pageContext); mySmartUpload.setTotalMaxFileSize(100000); mySmartUpload.setAllowedFilesList("doc,txt,jpg"); mySmartUpload.upload(); try { count = mySmartUpload.save("/upload"); out.println(count+" file(s) upload."); } catch (Exception e) { e.printStackTrace(); } %> </body> </html>
(upload文件夹应该建在哪呢?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
建在你的webroot下,上传的位置你可以写成"./upload",可以试下
你解决了没?我也是遇到同样的问题了