0

I have a excel file in server in the following directory. C:/test.xls I used the following method to directly open the server excel file in client machine. Desktop.getDesktop().open( new File("C:/test.xls") ); But the above method directly loads the excel file in server instead of opening in clients machine when user gives the request to open that file.

Is it possible to load above excel file in client machine.

If I give client machine's file path in the open() will it open the xls file in client machine

      Desktop.getDesktop().open( new File("Here Client Machines path") );

Or Is there any other way to open this in client machine instead of downloading. Please some one give a proper idea.

1 Answers1

0

You have to get the binary contents of the Excel file from the server to the client. Unfortunately, there's no magic here. Downloading via HTTP/TCP/InsertProtocolHere is the only way to transfer that file from server to client so that the openxls library can open it. Opening an InputStream on the client still requires the server to serve/send the binary file ( and approve of it being served ) from the server to the client.

user2591854
  • 182
  • 3
  • 15