Monday, December 30, 2013

Problem while uploading PDF files.

The way to solve this problem is to read the error message. It tells you that you have a type mismatch somewhere. From what you posted, we know that the column data is varbinary(50). Apparently, in your client code you have defined the parameter as varchar. Whence the mismatch.


The question remains what you actually have in the value you pass. Is that a byte strem or what is it? To wit, varbinary(50) is not a good type for storing PDF documents, since few if any PDF documents are less than 50 bytes in size.


I happen to have some sample code for loading blobs:

http://www.sommarskog.se/blobload.txt





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

No comments:

Post a Comment