Hi all,
Can u plz tell me as how to upload images.
I am developing an web application similar to picasaweb album.
I need to know as where the images to be saved(is it in database directly each image or just image path in database and files in application folder)

Can u plz provide me the database structure (if any ) similar to my application.

Expecting replyASAP

don't used to save images in database. because it will load your database server. so you can use image storage path in database server to view the image in your ASP.net page.

Hi

From your post on C# forum i believe you want to know how to upload files in C#. I agree with tuhin.bd that you should store filepath of the image rather than the image itself.

Therefore to save a filepath of the selected image, you will first get the filepath of the image by the following code, which can be either behind a command button or however you want to invoke.

OpenFileDialog opfd = new OpenFileDialog();
opfd.Filter = "Your extension here (*.EXT)|*.ext|All Files (*.*)|*.*";
opfd.FilterIndex = 1;


if (opfd.ShowDialog() == DialogResult.OK)
{
    filepath = opfd.FileName;
}

This filepath can then be stored in your database which can be of text type in microsoft access for example.
Make sure that the directory path at your host matches the path saved.
Hope this helps, if you would like to know about retrieval of images from database in c#, please let me know.
I dont know much about asp so i hope somebody else posts saving and retrieving in asp
Regards
Sarah

how to insert the data from datagrid to database by using data adopter in c# and sql server. plz if anybody get send it to me,my mailid is umaak.26.2.88@gmail.com

please tell me;
how to upload image in asp.net

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.