473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How can I upload images in my aspx page?

Hi all,

I want to let user to upload images on my site and put some discription too!

I want that these things should be saved in my database too.SO how can I achieve this?
Mar 26 '12 #1
8 2181
Frinavale
9,735 Expert Mod 8TB
Use the FileUpload control to allow the user to upload a file to the server.

Add a TextBox to the page so that they can enter a description.

Add a button so that the user can submit the page to the server. In that button click code, retrieve the file and either store it in database or in a file on the server...and store the description that the user entered into the database.
Mar 26 '12 #2
PsychoCoder
465 Expert Mod 256MB
First in my opinion it's bad practice to store images in the database. Going that route uses much more resources. If you are dead set on doing it that route then take a look at this blog post.
Mar 27 '12 #3
@PsychoCoder
yeah i think you right, my one of friend also told me same, can you suggest me way for how to store it at some folder, and latter how can I retrieve it back when i want!
Mar 27 '12 #4
dear on button click event what code behind I have to write that i exactly dont know so want help regarding that!
Mar 27 '12 #5
Frinavale
9,735 Expert Mod 8TB
Upload the photo to a folder in the website (maybe call it Images so you know what it's for and it makes sense in a URL path).

Store the name of the photo in the database.

When you retrieve the data to display it later, concatenate the photo name retrieved from the database with the url path to the folder when the image resides...and display it in an Image control (or html <img>).

-Frinny
Mar 27 '12 #6
CAn you please help me more??
I know this concept but getting hanged in programming!
Mar 27 '12 #7
PsychoCoder
465 Expert Mod 256MB
Did you look through the link I posted showing how to do what you're doing it?
Mar 27 '12 #8
Frinavale
9,735 Expert Mod 8TB
What exactly are you stuck on?
The uploading part?
The displaying part?
The saving into the database part?

-Frinny
Mar 27 '12 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nilesh | last post by:
I am using background-image attribute in a CSS file and linking the CSS file to aspx page. But strangly, background-image attribute is not working for relative URL. e.g. If I apply following css...
6
by: Shawn | last post by:
Hi. I'm letting the users upload images into a sybase 12.5 database. The problem is that when ContentLength exceeds 131 071 an exception occur. The e.Message property is empty so it doesn't tell me...
2
by: Sarah | last post by:
I am using the javascript showModalDialog function to open a file upload window. The function opens a page which contains a usercontrol housing the file upload stuff. The control works fine when...
2
by: engwar1 | last post by:
I have a page that my users will go to to upload files to my website. As I want to reuse the file upload code on multiple pages I put the file upload textbox/buttons on a user control which I plan...
3
by: Pierre | last post by:
Hello, In an aspx page (mypage.aspx) from a web projet, I would like to get the value of a variable of the projet that is declared as public in a module. The variable can be called from...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
2
by: john sun | last post by:
Hi, Dear gurus, In the web deployment project, there is one option called "Output Assemblies page". The first choice is "Merge all outputs to a single assembly", According to MSDN, "Merges...
3
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
Hi, I have an aspx page that has the "include" code in it which includes another page that displays information. I also have an upload page that allows users to upload a simple html document...
0
by: poojamangal | last post by:
I want to upload images or pdf files. but i m unable to do so. i got error. please help me to sort it out.. my code is: <% 'on error resume next Class FreeASPUpload Public UploadedFiles...
1
by: Afshar | last post by:
Hi all friends, I have a big aspnet project including several several .aspx .ascx .resx. I publish this project everytime that i want to deploy it. I use full compile-no update options so I just...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.