简体   繁体   中英

xlsx file corrupted during downloading from server

Folks, here is the situation:

  1. confirmed that the xlsx file is good on the disc. I copied the file from server and can open without problems.

  2. using FileInputStream and BufferedInputStream to handle the client side download function. The download function i mean user can download the file by clicking a hyperlink, and a servelet call was made to the java class which uses FileInputStream and BufferedInputStream

  3. Mime type was set correctly as application/vnd.openxmlformats-officedocument.spreadsheetml.shee

After download the file successfully, it will give a "converted failed" error while trying to use office 2003 to open this xlsx file.

any thoughts?

Thanks!

There are bytes which didn't belong in the HTTP response body or were simply missing there.

It's impossible to point out the actual root cause based on the information given as far. You have to check if the right bytes were written from local disk file system to the HTTP response body.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM