• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to download

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ram Dev chandran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
reply
    Bookmark Topic Watch Topic
  • New Topic