1

I have URL that gets called from my java app that returns the save/open dialog for an Excel file.

At the moment, it opens in a new tab but I want to return the dialog box in the same window. I do not know the file name as it is dynamic and changes based on the parameters passed in. I also do not want to save it somewhere as I want the user to have the choice of opening or saving.

Is there anyway of doing this in Java? I've only seen examples where the file name is known.

EDIT The URL is hitting a CGI Script

pm13
  • 735
  • 7
  • 23
  • 36

1 Answers1

2

Create a File object in your app from the url, store it in a temporary location then ask Excel to open it for you.

Community
  • 1
  • 1
fredley
  • 32,953
  • 42
  • 145
  • 236
  • I would rather not store it in a temp location. – pm13 Oct 21 '11 at 15:42
  • 2
    @pm13 You're going to have difficulty then, as you can *only* use Excel to open files if they're stored on the disk. – fredley Oct 21 '11 at 15:43
  • All I want is for the reponse from the URL, which is currently a Save As/Open dialog box, to be shown in the same window as the app, instead of opening in a new tab. – pm13 Oct 21 '11 at 15:56
  • @pm13 That's not possible, that dialog belongs to the browser. If you want it to open in your app you'll need to re-implement it. – fredley Oct 21 '11 at 15:59