aspose file tools*
The moose likes JBoss/WildFly and the fly likes Unable to download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Unable to download" Watch "Unable to download" New topic
Author

Unable to download

Ram Dev chandran
Greenhorn

Joined: Sep 20, 2011
Posts: 4
Unable to download the Docx from Applciation Server JBOSS and OS is CentOS and DB is Oracle

String primary_key = Lib.getSingleResult("SELECT upload_ticket_seq.nextval FROM DUAL", "", con);
pstmt = con.prepareStatement(sInsert);
pstmt.setString(1, master_key);
pstmt.setString(2, primary_key);
pstmt.setString(3, file_name);
pstmt.executeUpdate();
pstmt.close();

// select the row to update the BLOB column
pstmt = con.prepareStatement(sSelect);
pstmt.setString(1, primary_key);
rset = pstmt.executeQuery();

if (rset.next()) {
blob = ((OracleResultSet) rset).getBLOB(1);
} else {
status = "Error when extracting BLOB";
}
blob.trim(0);
out = blob.getBinaryOutputStream();
out.flush();
out.write(dataBytes, startPos, (endPos - startPos));
out.close();

Saving the Document(Docx) as BLOB Object into Database. downloading the docx properly, when Client and Server Machine is Windows XP/Windows 7 and ie7 /ie8. This is not working when Server is CentOS
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Ram, welcome to Java Ranch!

I assume you are saying that when you use a Windows PC to access the web site that the docx file gets successfully downloaded to the Windows PC and Word can open it. So things are working fine on Windows.

What do you mean by "not working" on CentOS? Do you mean that nothing gets downloaded at all? Or does something get downloaded but its contents are not what you expected? Exactly what is the behavior you are seeing.

Also, which browser are you using on Windows and which on CentOS?

My guess is that it has something to do with the browser configuration. The only difference in the working case (Windows client) and non-working case (CentOS client) is that you are using a different browser. You might have to configure the browser on CentOS to recognize the mime type used for docx files and have the browser react correctly (that is, download the the file and place it on disk somewhere).


JBoss In Action
Ram Dev chandran
Greenhorn

Joined: Sep 20, 2011
Posts: 4

Server Details
OS = CentOS
Application Server = jboss-3.2.3

Client Details

OS : windows xp / vista /7
browser : ie6 / ie7 / ie8

When im opening the docx it is opening with client and server as windows environment. but it is opening the warning message as "the content of document was corrupted" and then opening the document.
Ram Dev chandran
Greenhorn

Joined: Sep 20, 2011
Posts: 4
Hi Peter Johnson.

in Other words,

whatever it may be the server and client configuration, I need to download the doc / docx / xlsx kindly do the needful
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Sorry but I do not understand this:

When im opening the docx it is opening with client and server as windows environment. but it is opening the warning message as "the content of document was corrupted" and then opening the document.


I do not understand under what circumstances the download is working and under what circumstances the download is not working.
Ram Dev chandran
Greenhorn

Joined: Sep 20, 2011
Posts: 4
The docx download is not working
---------------------------------------

Server Details
Operating System : CentOS
Application Server : Jboss



The docx download is working
----------------------------------

Server Details

Operating System : windows xp / vista / 7
Application Server : Jboss
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

This still does not tell me what I need to know. What is the client OS and what is the client browser in each case?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to download