ASP.Net Upload image to Database
As we know images and pictures play an important role to attract visitors to visit your web site again and again. But during the development phase of web applications it becomes an issue that. . . how to store and display images dynamically on web pages?
There are 2 ways to store images in ASP.Net 2.0:
1. Upload images to a folder
2. Upload/Store images into the SQL Database
The main issue for uploading images is web space. You need more web space for hosting your images on the web server. To get information and comparison between best web hosting providers for ASP.Net 2.0 enabled web hosting you can consider the following articles:
If you are developing a web site of photo sharing or albums then you can’t store images into the database, coz this will make your database very bulky to store the other profiles and data.
So, you have to adopt the first method to upload the images to a folder.
Things to remember to upload images into the folder:
1. There should be folder (Directory) where you’re going to host your web application or where you’re developing your web application i.e. localhost.
2. Your web application’s IIS authenticated user must have read/write access to the directory in which images will be uploaded.
3. Protect your images directory from being accessed by anonymous users. Otherwise anonymous users can directly access the uploaded images without browsing your web site.
Following the above steps you are ready to use the folder for uploading the images and display them dynamically on the web pages of your ASP.Net 2.0 web application.
Learn more about How to use ASP.Net 2.0 file upload control to upload your images to a folder.
Continue to next tutorial: ASP.Net Upload image to Database -1 to learn about upload the images to SQL database.