INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

error downloading a file which was uploaded to a mssql database

error downloading a file which was uploaded to a mssql database

error downloading a file which was uploaded to a mssql database

(OP)
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

RE: error downloading a file which was uploaded to a mssql database

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close