Link to home
Start Free TrialLog in
Avatar of razza_b
razza_b

asked on

Photo file upload C#

Does anyone know how to do a file upload so that the file is added to a gallery for  asp.net 4 C#?

so when a user uploads a file they see it in a gallery right away.

Thanks
Avatar of gdupadhyay
gdupadhyay
Flag of United States of America image


Best way: Upload the image and stored in a folder with unique name.
Store the image path in database table and during page load, read all pic file path for login user
and display in your web page.

You can store the image in database, but it will make large DB. It took more space.


Let me know if you have any question.
You can see below URL for reference:

http://www.codeproject.com/KB/aspnet/fileupload.aspx

Good Luck
Avatar of razza_b
razza_b

ASKER

Is there any other way to store it other than db if it makes db very large?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of tbsolutions
tbsolutions
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For the application like your application (Pic gallery) , Storing image in file system (In a physical folder) easiest and the best way.

There are some advantages and disadvantages in both. But for web application, file system is best.

Please see below URL.

http://www.findbestopensource.com/article-detail/store_image_db_or_file#
http://msdn.microsoft.com/en-us/library/aa260858(v=vs.60).aspx
You can store in physical folder with unique name for every image.

Like ../Images/image_1_1234.jpg

During upload, you just need to assign unique name to the image file and move into Image folder. Just store the reference
path for uploaded image in database table.
Avatar of razza_b

ASKER

Thanks for feedback guys.

tbsolutions - I like the carousel look, would this be the only code needed to do this from this page?...
Getting Started Section....
Dynamic content loading Section..
Accessing the jCarousel instance Section..

gdupadhyay: I think i'd prefer the file system but do you have any code examples of how to do file upload and having it displayed using this method?

And would the carousel pick load up the photos from the file system?


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial