Downloading a CSV File

When downloading a csv file from my application, it appends the html code() also.  I am using:

Content-Type: binary/csv
Content-Disposition: attachment;filename= test.csv

The CSV file contains..

DNO123,1,3nnec3,20050119,155,100,PALLET1
DNO123,2,3nnec3,20050119,155,12,PALLET3

<html>
<head>
<TITLE>Detail</TITLE>
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0">

<form method="post" name="form1" action="">
<input type="Hidden" name="MESSAGE" value="">
<input type="Hidden" name="ispreview" value="ispreview"> <input
type="Hidden" name="isdownload" value="isdownload"> .
.
</html>

Well there should be "synchronize" in your IDE.  CVS terms:

1. Commit -> over-writes the cvs-server file with your local-file (out-going)

2. Update -> over-writes your local-file with the latest  cvs-server file (in-coming)

3. Synchronize -> displays all the files that are of different version and shows you which one is new or old

Now when you update and you see a lot of garbage characters this can only mean:

1. a user committed a file that has a different encoding.  You might be using UTF-8 while he is using Big5

2. OS language use is different.

3. the server is screwed ;(

Charcters like this:
DNO123,1,3nnec3,20050119,155,100,PALLET1
DNO123,2,3nnec3,20050119,155,12,PALLET3

or any character that shows on top of the document that has no meaning at all was only meant for the server and the client. If you see this, there is something wrong with how you create, commit or update stuff.

-- Steve Torrefranca

Related:

Java Books
Java Certification, Programming, JavaBean and Object Oriented Reference Books

Return to : Java Programming Hints and Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.