下面是我寫的,我下載一個文件的代碼, 現在我需要將文件下載到客戶端中的特定位置system.I'll打通路徑來自用戶的輸入。 我知道這不是好惹的客戶端系統,但我不得不這樣做將文件下載到特定位置在客戶端系統
//setting the content type of response
response.setContentType("application/"+strFileType);
response.setHeader("content-disposition","attachment; filename="+strFileName+"."+strFileType);
//creating a file input stream object
InputStream input = blob.getBinaryStream();
//declaring a variable
int i;
while((i=input.read())!=-1)
{
//writing output
printWriter.write(i);
}
//closing the streams
input.close();
printWriter.close();
無法從服務器完成。這將是一個很大的安全漏洞。 – madth3
似乎這是服務器端代碼...你在客戶端嘗試過什麼? – vels4j
如果您已經以需要此功能的方式設計了程序,那麼您(可能)要麼設計惡意軟件,要麼設計錯誤。 –