Forums Register Login

Problem while downloading file from server

+Pie Number of slices to send: Send
Hi all

I have 2 frames in my jsp and the second frame has a file which is on the server and in the top frame i have download the file . On clicking this i go to server and i will flush the stream to the response by setting some headers .

Then a open/save dialog box comes up and after saving the file, nothing will work in my top frame as it says "Unspecified Error" at the client side (in javascript)

This is because the document is getting null after this .

can any one let me know what might be the problem .


Regards
Sreenath
+Pie Number of slices to send: Send
Out of curiosity, why do you have an entire frame devoted to downloading a file? I understand if it's a file that could be displayed within the frame, like a pdf or a movie for example, but if it's something that needs to be downloaded why not just have a link?

And as always the relevant samples of your code are always helpful.

-Yuriy
+Pie Number of slices to send: Send
I have the bottom frame for showing the data in the file .if the user wants to download that

file (As its on the server ) we have this download option.

And coming to my top frame where there are few buttons

<a href="/export.do?id=test.html" class="two">Download</a> . When the user clicks download it goes to a servlet and sets the response headers as

1. response.setContentType("application/x-download");
2. response.setHeader("Content-Disposition", "attachment; filename=Report"+id+".zip");

and after open/save dilaog , i save this file .After this other functionalities in the same
page wont work and javascript error comes up on clicking saying "Unspecified error" .The reason is document object is not available for the frame .

But doing some research i got to know that there is some problem with the header 2 i am setting for the response .If i remove this everything works fine. but i cant remove that as the file name while saving will come as "export.do" for that file.

can any one tell me what might be the problem ?? r else is there any header substituting the header 2 so that i get appropriate file name
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1295 times.
Similar Threads
Frameset Refresh Problem
window, frame, progressbar modal
Saving a ms word doc on the server
IDEA: web-based JSP editor for final markups...
Access Denied error in Javascript
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:57:46.