java有參和無(wú)參的區(qū)別 java web項(xiàng)目中圖片上傳瀏覽的路徑?
java web項(xiàng)目中圖片上傳瀏覽的路徑?字符串文件名=(字符串)請(qǐng)求.getAttribute(“fileBrowser”)如果(fileName!=空值(&A)文件名.trim().length(
java web項(xiàng)目中圖片上傳瀏覽的路徑?
字符串文件名=(字符串)請(qǐng)求.getAttribute(“fileBrowser”)
如果(fileName!=空值(&A)文件名.trim().length()> 0){
File File=新文件(文件名)文件.getPath()]}
在servlet或actoin中。
過(guò)去傳遞的頁(yè)面只是一個(gè)字符串,需要單獨(dú)處理。
另一種方法是使用Ajax提交。
-----<form name=“form1”action=“/LVMH/management/refresh Data Chinese”><input type=“file”name=“fileBrowser”size=“50”onchange=“readFile(this)”/><input type=“submit”id=“box BTN”> update</input></form>