your servlet code looks quite similar to mine - the only differences I can se: * I explicitly set the response code: response.setStatus (HttpServletResponse.SC_OK); * I explicitly flush the stream after writing the data: response.getOutputStream().flush()
If this does not help, I recommend: * user firebug and check the http-response * when you download the file: do a binary compare with the original file and see if it's the same On Aug 8, 5:11 pm, kike <[email protected]> wrote: > Hi, > > I'm trying to display images stored as blobs (no problem at > uploading). > > my client side code: > *********************** > Image photo = new Image(); > photo.setUrl("app/servlet?photoId=12345.jpeg"); > > my servlet's: > *************** > resp.setContentType("image/jpeg"); > // ... get blobData from database ... > resp.getOutputStream().write(blobData.getBytes()); > resp.setContentLength(blobData.getBytes().length); > > the result: > ... a big [?] > > If i inspect the element i get: > > http://localhost:8080/kiblog/displayImage?photoId=1249737316478.jpeg > Request Headers > Referer:http://localhost:8080/Kiblog.html > Response Headers > Content-Type:image/jpeg > Server:Jetty(6.1.x) > Transfer-Encoding:Identity > Resource interpreted as document but transferred with MIME type image/ > jpeg. > > My environment: > gwt 1.7 > safari 4.0.2 or ie 6 > > More over when I try to download the file it get in to my files with > the same length as the original, with binary data in it but the system > does not recognize it, here's the message: "Couldn't open the file it > may be corrupt..." > > Cheers, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
