Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error downloading a file which was uploaded to a mssql database

Status
Not open for further replies.

mThomas

Instructor
May 3, 2001
404
US
I'll post code if requested, but I'm not convinced it is a coding issue. I upload a pdf or excel file to a mssql (2012) database. When I download the file I get "There was an error opening this document. The file is damaged and could not be repaired." This doesn't happen with text files, images or video files, but does happen with Excel and almost all pdf, but not all.

There seems to be a lot on the net about the issue, but no resolutions which have worked.

The files including the pdf files upload just fine. Has anyone come across this before? Is it a coding issue? Is it a server config issue?

I need to get this solved. I might be willing to hire someone as a temporary consultant to resolve the issue.

I'm using a mssql 2012 and vb.net (2008).

mike
 
I figured out what I was doing wrong. It was a coding issue. I was not calling the file content type in my download code. So if anyone is searching for a solution to their files being damaged when they try to open a file from a database, make sure you are referencing the content type. Referencing the file content type is not necessary for some file types, but is for others.

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top