Note that there are some explanatory texts on larger screens.

plurals
  1. POimage upload problem with ie7
    text
    copied!<p>i am uploading image from a simple html form</p> <pre><code> &lt;form action="../OctetStreamReader" method="post" accept="image/gif, image/jpeg"&gt; Your image: &lt;input type="file" name="pic" id="pic" /&gt;&lt;br /&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre> <p>and inside OctetStreamReader i am copying the image on server using IOUtils</p> <pre><code>realPath = getServletContext().getRealPath(DESTINATION_DIR_PATH) + "/"; PrintWriter writer = null; InputStream is = null; FileOutputStream fos = null; try { writer = response.getWriter(); } catch (IOException ex) { log(OctetStreamReader.class.getName() + "has thrown an exception: " + ex.getMessage()); } if (canInsert) { // String filename = request.getHeader("X-File-Name"); String filename = utils.createFileName(ssn, userEmail, userId); try { ImageCompressor ic= new ImageCompressor(); is = request.getInputStream(); fos = new FileOutputStream(new File(realPath + filename)); logger.info("avalible bytes :" + is.available()); IOUtils.copy(is, fos); logger.info("inserting copied"); </code></pre> <p>the code is working absolutely fine in all browsers except IE and especially IE7. In case of IE7 , a new file is created on the server but with file size 0kb. and In case of other browsers like chrome,FF,safari , new file is created with the actual size of uploaded image. i am unable to trace out the problem as the code is not throwing any exception.</p> <p>Please Help ..</p> <p>Thanks !</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload