473,396 Members | 1,996 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,396 software developers and data experts.

Javascript validation for file to be uploaded

How can i validate the file that is to be uploaded? I want that only jpeg file should be uploaded. I know, its simple and many webpages has the solution but.... that method has a loop hole.
That method allows the uploading of any other image type if user just rename that extension by jpeg.
I dont want that.
I want that only real jpeg files should be uploaded
Thanking you in anticipation
Any slightest hint will be appreciated
Jul 16 '11 #1
1 1291
Dormilich
8,658 Expert Mod 8TB
there is no reliable way to determine with JavaScript, whether the file actually is a jpeg.

there are things, that JavaScript is not intended to do and file handling is among them.
Jul 16 '11 #2

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

Similar topics

5
by: JJ_377 | last post by:
I want a JavaScript validation function to fire on an ASP.NET textbox's change event. Here's what I've been trying and it is not working. The following added in the webform's page load event: ...
3
by: Mike P | last post by:
I have a method that I use for Javascript validation (see below). What I want to do is change the alert title, buttons, icon etc. Does anybody know the correct syntax to do this? private void...
4
by: kktnguyen | last post by:
Hello, Please help me with this code..I have 4 forms which link to different htmll page. I try to write one validation file that can validate for the form whenever user click on that form.How do I...
1
by: karen987 | last post by:
I have a comment form, on a news website, ASP page, which users fill in and it adds comments to a news article. The reader clicks on a headline and the comments open up in a new window. It already...
1
by: ll | last post by:
Hi, I am working with a page that has both cfform elements and 'plain html' form elements. In particular, I am needing to validate my textarea form field and my email text field. On one of my...
1
by: shrin | last post by:
Hi all, I want to use asp.net validator and javascript validation function on a single form for different fields. also I want to execute some code on button click after the validation is completed....
21
by: kiran83 | last post by:
My Text box can accept all types of data like alphabets,numeric,special characters ... Should give an error message 'if space is not a valid value ' when i am clicking a button... in asp.net with...
1
by: jerrydigital | last post by:
Hello, I have a form that i use ASP to process the form to my access database. It works well but I'm struggling to get the javascript validation to work. I have posted a small version of my form...
12
by: btreddy | last post by:
Hii Experts, im facing a problem with the javascript validation.i've a gridview in my web form and added a footer tempalte and placed textboxes in tht tempalte ,just to add a new row to the...
3
by: gayuvinu | last post by:
Hi, I am new to javascript, I need your help in javascript validation of a string. string of length 6, last 4 characters can be padded with "8" while entering. valid strings are ZJJL74 ZJJL7*...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.