第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

D:\temp (拒絕訪問(wèn)。)這個(gè)報(bào)錯(cuò)咋辦??

?手動(dòng)創(chuàng)建:temp這個(gè)文件夾 完整路徑為: D:\temp\temp.txt

正在回答

3 回答

InputStream fileSource ?= request.getInputStream();

//得到服務(wù)器的根路徑

String rootPath = request.getRealPath("/");

//指定文件存放路徑

String realPath = rootPath + "/" + "upload";

//定義文件存放的目錄,注意 目錄也是文件

File file = new File(realPath);

//如果目錄不存在

if (!file.isDirectory()) {

//創(chuàng)建文件上傳目錄

file.mkdirs();

}

File newFile = new File(realPath + "/" + "tempFile");

//向newFile文件中寫入數(shù)據(jù)

//文件存放在Tomcat中項(xiàng)目的根目錄下的upload文件夾中

FileOutputStream outputStream ?= new FileOutputStream(newFile);

byte[] b = new byte[1024];

int n;

while((n=fileSource.read(b))!=-1){

outputStream.write(b,0,n);

}

outputStream.close();

fileSource.close();

System.out.println("Post..");


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

辰塵

這個(gè)寫完不報(bào)錯(cuò)- -可是我找不到上傳后的文件在哪
2018-09-29 回復(fù) 有任何疑惑可以回復(fù)我~

你解決了嗎拒絕訪問(wèn)?

0 回復(fù) 有任何疑惑可以回復(fù)我~

手動(dòng)創(chuàng)建:temp這個(gè)文件夾 完整路徑為: D:\temp\temp.txt

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

D:\temp (拒絕訪問(wèn)。)這個(gè)報(bào)錯(cuò)咋辦??

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)