• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

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
0
razza_b
Asked:
razza_b
  • 5
  • 2
2 Solutions
 
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now