954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Image Uploading using c#.net + asp.net

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

sireesha.c
Newbie Poster
17 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

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.

tuhin.bd
Newbie Poster
1 post since May 2009
Reputation Points: 10
Solved Threads: 0
 

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

brainbox
Light Poster
29 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

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 [email]umaak.26.2.88@gmail.com[/email]

umaak
Newbie Poster
1 post since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

check this thread it has discussion related to your problem

abelLazm
Postaholic
2,113 posts since Feb 2011
Reputation Points: 219
Solved Threads: 124
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You