473,804 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

In Java Corrupted Excel file

1 New Member
Hello,


Language= Java;
Platform= Linux;
Application= Web

I have help excel file. I download it using FileInputStream .
When it is downloaded from solaris or widows platform it is correct.
But when it is downloaded from Linum platform it becomes corrupted.

Expand|Select|Wrap|Line Numbers
  1.  
  2. PrintWriter out = new PrintWriter(response.getOutputStream());
  3. response.setContentType("application/excel");
  4. response.setHeader("Content-Disposition", "attachment; filename=\a.xls\");
  5. //Sending the file
  6.     int iRead;
  7.     FileInputStream stream = null;
  8.     File f = new File("a.xls");
  9.     stream = new FileInputStream(f);
  10. //Writing the stream values 
  11.     while ((iRead = stream.read()) != -1)
  12.     out.write(iRead);
  13. //Flush the output
  14.     out.flush();
  15.  
Kindly, provide me solution.
Apr 4 '07 #1
0 1286

Sign in to post your reply or Sign up for a free account.

Similar topics

2
47282
by: SubbaRao Karanam | last post by:
What does this error for the Code below java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at com.kbs.framework.client.gui.PIPReport.doProcess(PIPReport.java:562) at com.kbs.framework.client.gui.PIPReport.actionPerformed(PIPReport.java:508) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at...
11
9281
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
1
1252
by: Tony Moss | last post by:
I have a small new, simple db in Access 2002 WinXP running on a network (3 users) and vpn Terminal services (2 users). Just 2 tables Clients and sub form / table Purchases. This last week we have been pumping in the old paper files and now suddenly (400th record) the backend shows "Access 2000 file format" and the Clients table seems to be corrupted. Cannot compact/repair, cannot export contents to Excel, cannot import the table into a new...
1
4392
by: Boomessh | last post by:
Hi, I am trying to open an existing excel workbook. It pops up an error stating that “Errors were detected in 1598.xls but Microsoft Office Excel was able to open the file by making the repairs listed below. Save the file to make these repairs permanent.” ‘Renamed invalid sheet name.’“ This message is popped up when the XLS file has work sheet with the name like rpt:coursedetails etc.,
1
9666
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
5
1836
by: jeffreywgraham | last post by:
Laptop lost power while on an airplane. No big deal, but the Access database that I was working on at the time now won't open. I've tried to repair it, I always get the error message about the file being corrupted. I can, however, open tables and queries through Excel, so the data is intact. What I'm mainly hoping to get back is the VBA code I wrote while my flight was delayed...any suggestions Many thanks in advance
0
1064
by: SuperFly07 | last post by:
Any Java Gurus out there that can help. I need to write a java class which will disable password protection on the Excel file in a folder and we use that file to store data in table. So script must automate disabling password protection and then upload to our sybase database using our Java loader. I am trying to automate this process. The process is we get a excel file which is password protected, password is supplied to us, we input the...
2
5191
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am trying to do is to convert an .xml using a .xsl to and using a java script to output it into a readable format within excel. I have been able to successfully use a javascript to combine my .xml and .xsl but cannot figure out how to have it output to...
1
1853
ddtpmyra
by: ddtpmyra | last post by:
When Im downloading a file from mysql database the file is already corrupted below are the code I used on downloading to mysql and uploading from mysql. PDF file are doing okay as long as it is a small size, but the excel and words are totally corrupted. Can you please take a look if im doing it correctly. Note: the filedata in mysql = longblob Uploading to mysql <?php # Check if a file has been uploaded
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10594
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10087
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.