This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
how can we open an existing named file (e.g abc.doc) in word application,not in browser,using servlet.when i try to do this i get security related message.because when we open word application in normal way then it is Winword.exe file that run,not Winword.doc file.on the other hand i'm trying to open abc.doc file in its application program,remeber not in browser. thanks in advance. khurram mirza.
The "inline" option means to open within the browser. In IE, you can edit the document - the browser simply becomes the Word parent frame, but it doesn't set up the familiar menu and toolbar stucture as it would if Word had launched externally. For more info on the Content-Dispostion header, I recommend you search the Web using Google or whatever engine you are most comfortable with.
Tim, did you mean PDF file through your snippet? I checked out the Content-Disposition header on google. Interestingly, one of the posts on one site suggested response.setHeader("Content-Disposition" , "Mohammed; filename=\"MailingLists.pdf\""); The post, whose name is Mohammed, went as far as saying we can use our own name in place of Muhammed. Some other posts said we can use response.setHeader("Content-Disposition" , "attached; filename=\"MailingLists.pdf\""); What does the first field of the second parameter in response.setHeader() do? Thanks
Whoops! I had a 1 in 3 chance of getting it right. You're correct - my snippet was for a PDF document, but I think you can tell what you'd have to to for Word. This may help: http://www.faqs.org/rfcs/rfc1806.html There's a known bug in content-disposition handling for some versions of IE, BTW.
Joined: Jun 10, 2001
tim,is there any possiblity that the file opened in browser from server is saved after modification and it is saved to server from where it is downloaded.apprenetly it is not possible because when save option is clicked the dialogue box appeared to save it on client site.but i have to save it on server side by using save option(not 'save as' because file name can be chenged with this).
It's tricky. As I've said here before, a web server is not a file server. Since you're working with a Word document, you might want to see if you can create a VBA macro in the document that causes it to be posted to a file upload servlet or JSP. I've never tried such a thing, but it's a fairly good bet. It's not likely that Word or Windows is going to have a security barrier to stop you