We help IT Professionals succeed at work.
Get Started

Asp.net file upload validation using javascript and C#

Devildib asked
Last Modified: 2016-02-02
Hi experts,

I have an asp.net webform on which i have various controls like text boxes and a file upload control with browse textbox , button and an upload button.I have a validation check in place for gif image uploads only.When i upload an image, the image gets displayed in an image control.Now, as a negetive testcase, when i manually enter a something in the browse textbox like abc.gif, the extension check gets by passed in javascript.And control doesnot pass on to the c# upload click event.Can you provide some logic for complete validation client and server side?I need to do this using javacsript and c# only.
Watch Question
Research & Development Manager
This problem has been solved!
Unlock 3 Answers and 12 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE