Tuesday, March 20, 2012

Question about how to upload file into database(sqlserver express)?

I'm a newbie.

I have googled many web sites,but i can't find the help that how to upload or store files(include images) into a database with Asp.Net 2.0.

Although i have found few samples about storing images into database,but the sample applied with Asp.Net 1.0 or 1.1 technology...

In microsoft MSDN,i found the help about FileUpload control,but the sample is about how to upload files to servers's folder with saveas() method.

Who can help me ?Give me a refer sample about upload files to database with Asp.Net 2.0. Is it need to use stream or what other method?

By the way, i want make a document managment system with vwd and sql express.

Thank u very much if u can give me a help.

The FileUpload control has a FileBytes property that has the raw bytes of a file. You want to save that data to an image column in the database.

I'm not a big fan of storing documents in a database. It wasn't designed for that, and while it can work, it doesn't work well. You're probably better off using the filesystem for the files, while storing the information about the files in the database.

Incidentally, if you're storing important stuff (legal documents, medical records, stuff like that), and you're not keeping the originals, you're asking for trouble.

|||

"you're not keeping the originals, you're asking for trouble."

why?

No comments:

Post a Comment