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
LVL 1
razza_bAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gdupadhyayCommented:

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.
0
gdupadhyayCommented:
You can see below URL for reference:

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

Good Luck
0
razza_bAuthor Commented:
Is there any other way to store it other than db if it makes db very large?
Thanks
0
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

tbsolutionsCommented:
You need to choose which one is gonna be large, the db or the application... i guess it's better to store it in a db line than physically inside the application's directory.

After choosed, you can use a jQuery plugin to have a good visual result.

http://sorgalla.com/projects/jcarousel/

gl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gdupadhyayCommented:
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
0
gdupadhyayCommented:
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.
0
razza_bAuthor Commented:
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?


0
gdupadhyayCommented:
You just need to follow the file upload process, both are same.

See for example:
http://howinaspnet.blogspot.com/2010/06/give-unique-name-to-uploaded-file-in.html

Save the file path in a table and each file (pic) should be refer to user.

After saving, you just need to read all the pic file for the user and display into screen.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.