Reply from Reddeiah on Jun 22 at 12:57 AM Hi thanks a lot for reply .. The problem is that its downloading through form ajax hit but while displaying the image its showing blank, ansd saying "invaid image format", but the same is working in windows. i tried with the instructon as you said.. response.setContentType("image\jpeg"); but in eclipse itself its giving error "Invalid escape sequece .." :( here is my code if (parameterChanges!=null) { blob=parameterChanges.getInfraLayoutImage(); fileName=parameterChanges.getParameterValue(); } if(blob!=null && blob.length()>0) { InputStream fileFromDb=blob.getBinaryStream(); FMMLogger.debug("Processing Image in fetchImage path method .. "+fileFromDb); String disHeader=""; if(fileName!=null && fileName.length()>0) { disHeader = "Attachment; Filename=\"" + fileName + "\""; } else { disHeader = "Attachment; Filename= Infrastructure.jpeg"; } response.setContentType("image\jpeg"); response.setHeader("Content-Disposition", disHeader); FMMLogger.debug("Processing Image in fetchImage path method .. header information" + "\nresponse.getCharacterEncoding() = "+response.getCharacterEncoding()+ "\nresponse.getContentType() = "+response.getContentType()+ "\nresponse.getBufferSize() = "+response.getBufferSize()); printWriter=response.getWriter(); while((fileData=fileFromDb.read())!=-1) { printWriter.write(fileData); } FMMLogger.debug("Imgae is written to PrintWriter object .. "+printWriter); printWriter.flush(); printWriter.close(); } }
| | | ---------------Original Message--------------- From: Reddeiah Sent: Thursday, June 21, 2012 11:58 AM Subject: Content Type Not Working in Linux Environment Hi i used the below content type response.setContentType("image/jpeg"); Actually in our app we have to upload and download one image for that i used regular DataInputStream and Byte[] etc. its working in windows environment and image got downloading but not working in linux environment :( . is there any different for windows and different exist. kindly help me | | Reply to this email to post your response. __.____._ | _.____.__ |
No comments:
Post a Comment