I have raw bytes which i want to write to the response(these raw bytes are contents fo a file).I want to write these bytes to a particular location (say a file) on the machine from which my servlet got the request.
When the response is sent to he client, if they want they can save it to the file system. If they choose not to there is nothing you can do about it. The client saves it where they want, you have no control over this and cannot suggest locations or affect it in any way. You can't even specify a default save location.
Joined: Dec 28, 2004
What would be the content type to be set, for sending the .xls file content , to the response.
And when user will get the option to save the content would it be by default get saved as .xls file???.Because i want that the user obtains the same xls file format generated on my server in their local machine as an xls file.
I am able to download & save the files as excel files.The browser automatically opens my stream content with the excel as it is already installed on my machine.
But some problems i am facing are as follows:
1) When i save the file & then try to open that saved file the OS doesn't allows me to do taht .It says already a file with the filename which i have given to my saved file is open.So i have navigate back into my application then i am able to view that file.
But sometimes, after navigating back also i am not able to view the file i am able to view just the Microsofts Excel Application's Menu & its footer but not the content of my file.
When i analysed the problem i found that even after navigating back in the application an instance of EXCEL.exe remains active in the taskManager.That it doesn't get killed.Finally when i close my application i am able to view the file properly.
2) When i have a single file i am able to download & save it easily.But in some cases i have mutiple files to be downloaded & saved so how can i do this thing of downloading & saving multiple files coming in the response.
Here is my code for downlaoding my reports:
Joined: Dec 28, 2004
My first query is solved Kindly help me sort out my second query of downloading multiple files.
Also i am not able to delete my file on the server after downloading it . Jignesh [ April 06, 2006: Message edited by: Jignesh Gohel ]