下面是我编写的用于下载文件的代码,现在我需要将文件下载到客户端系统中的特定位置。我将通过用户输入获取路径。我知道弄乱客户端系统不好,但我不得不这样做
//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();