JSP を使用して Web ベースのアプリケーションを作成しています。クライアントに曲のリンクをいくつか提供しました。クライアントがリンクをクリックすると、そのファイルがクライアント マシンに保存されます。ただし、クライアントがリンクをクリックすると、サーバー画面にファイル保存ダイアログ ボックスが開きます。クライアント マシンで開くには、何をする必要がありますか? 私のコードスニペットは次のとおりです。
fis=new FileInputStream(path);
bis=new BufferedInputStream(newProgressMonitorInputStream(null,"Downloading File : "+fileName,fis));
JFileChooser chooser=new JFileChooser();
chooser.showSaveDialog(null);
if(chooser.getSelectedFile() != null)
{
String savePath=chooser.getSelectedFile().getPath();
modifiedPath=(savePath.replace('\\','/')).concat(".mp3");
fos=new FileOutputStream(modifiedPath);
bos=new BufferedOutputStream(fos);
int c;
int i=1;
try
{
while((c=bis.read())!=-1)
{
bos.write(c);
i +=c;
}
}
}
file name はダウンロードするファイルで、savepath はファイルを保存するクライアント m/c 上の場所です.... fis、bis、bos、fos すべてがストリームです。助けてください..事前にthnx