我正在嘗試文件上傳功能,該功能似乎正常工作,因爲該文件出現在C:/ xampp/tomcat/temp文件夾中。但是,響應返回爲以下錯誤:使用java servlet訪問HTML 5文件的上傳被拒絕異常
java.io.FileNotFoundException: C:\xampp\tomcat\temp (Access is denied) java.io.FileNotFoundException: C:\xampp\tomcat\temp (Access is denied)
The server encountered an internal error that prevented it from fulfilling this request.
java.io.IOException: java.io.FileNotFoundException: C:\xampp\tomcat\temp (Access is denied)
Main.FileUpload.doPost(FileUpload.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root causejava.io.FileNotFoundException: C:\xampp\tomcat\temp (Access is denied)
java.io.FileOutputStream.open(Native Method)
java.io.FileOutputStream.<init>(Unknown Source)
java.io.FileOutputStream.<init>(Unknown Source)
org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.write(DiskFileItem.java:391)
Main.FileUpload.doPost(FileUpload.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
如果有什麼問題該怎麼辦?
你檢查文件夾的權限?你有沒有試圖用適當的權限在那裏創建一個文件夾? – PbxMan 2014-12-02 15:09:37
權限是完全訪問,因爲我是管理員(這一切都發生在我的電腦上) – 2014-12-02 15:12:38