I’m developing a webapp where the user is given the chance to upload his resume in pdf format. I’m using NHibernate as a data mapper and MS SQL SERVER 2005.
I want to be able to save the .pdf file to a given table… any ideas?
Thank you very much!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
We are doing exactly that with the ‘original’ Java Hibernate3. You just map a byte array property of your persistable class to an column of Type ‘image’.
Hibernate Mapping:
Table creation:
All you have to do is to read the documents raw bytes into the array and persist it. In our situation the documents will get hardly larger than 1MB , so putting the whole thing into the byte-array won’t cause performance issues. Maybe this solution isn’t feasable for very large documents.
I guess with NHibernate implementation and C# the solution will look very similar.