cancel
Showing results for 
Search instead for 
Did you mean: 

download content stream failing

vchiluku
Champ in-the-making
Champ in-the-making
we use opencmis in our webapplication to interact with alfresco (soap binding). In version 4.1.5 enterprise, connection.getInputStream() is failing to download complete document. content is getting truncated at 11kb.

                URL url;
      URLConnection conn;
      String downloadUrl;
                url = new URL(downloadUrl);
         String loginPassword = alfrescoUsername + ":" + alfrescoPass;
         String encoded = new sun.misc.BASE64Encoder().encode(loginPassword
               .getBytes());
         conn = url.openConnection();
         conn.setRequestProperty("Authorization", "Basic " + encoded);
         response.setContentType(mimeType);
                        response.setHeader("Content-Disposition", "attachment; filename=\""
               + filename + "\"");
         response.setHeader("Content-Transfer-Encoding", "binary");
                        FileCopyUtils.copy(conn.getInputStream(),
               response.getOutputStream());
         response.flushBuffer();

Same code works fine with alfresco 4.0.1. does any one know if any changes/updates added in 4.1.5 enterprise version.
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
how you are initializing "downloadUrl"? I can't see it?

vchiluku
Champ in-the-making
Champ in-the-making