I tried content type as application/msword but it did not help .Any other ways to solve this problem?
thanks & regards
Note: forwarded message attached.
thanks & regards
Note: forwarded message attached.
Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.
--- Begin Message ---Just a thought. Isn't there a specific content type for .doc documents? That might solve your problem.I looked it up. .doc documents are "application/msword". Try that and see what happens. I am actually building a list of all the extensions and their content types. Hope this helps.On 1/18/06, temp temp <[EMAIL PROTECTED]> wrote: > I am using struts action class to download a file . > > > Here is the action class > > public ActionForward execute(ActionMapping aActionMapping, ActionForm > aActionForm, > HttpServletRequest aHttpServletRequest, HttpServletResponse > aHttpServletResponse) > throws Exception { > > aHttpServletResponse.setContentType("application/octet-stream"); > aHttpServletResponse.setHeader("pragma", "no-cache"); > aHttpServletResponse.setHeader("Cache-Control","cache"); > aHttpServletResponse.setHeader("Cache-Control","must-revalidate"); > > Integer aSysAttachId = new > Integer(aHttpServletRequest.getParameter(IWeb.SYS_ATTACH_ID)); > aHttpServletResponse.setHeader("Content-Disposition", "attachment; > filename=\"" +aHttpServletRequest.getParameter(IWeb.FILE_NAME)+ "\""); > > download(aApplicationInfoDelegate.getApplicationAttachemntFile(aSysAttachId),aHttpServletResponse); > return null; > } > > private void download(byte[] byteArray, HttpServletResponse > httpServletResponse) > throws IOException, SQLException { > try { > BufferedOutputStream aBufferedOutputStream =new > BufferedOutputStream(httpServletResponse.getOutputStream()); > aBufferedOutputStream.write(byteArray,0,byteArray.length); > aBufferedOutputStream.close(); > } catch (Exception e) { > throw new IllegalArgumentException(e.getMessage()); > } > } > > My problem is with all ".doc "files and some ".pdf" files .When user > clicks on the link , the browser opens a dialog box with the option to save > or open the file .Suppose he has choosen a ".doc" file to open , the > browser opens micorsoft word with an error message > > Word experienced an error tying open the file. > Try these suggestions. > * Chaeck the file permissions for the document or drive. > * Make sure there is sufficient free memory and disk space > * Open the file with the text Recovery converter. > > > I also had other files like .xls and lot of .pdf and there is no problem > with these files but with all .doc files. > Can Somebody guide with this issue. > Thanks & Regards > > > > > > --------------------------------- > Yahoo! Photos > Ring in the New Year with Photo Calendars. Add photos, events, holidays, > whatever. > -- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--- End Message ---
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]