473,324 Members | 2,254 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,324 software developers and data experts.

how to validate input type file using javascript for file type and size?

how to validate input type file using javascript for file type and size?
Oct 27 '13 #1
1 2192
Dormilich
8,658 Expert Mod 8TB
not as easy as you might wish.

you have access to the file name through the input's value property, but there you can only check for the nominal extension (there is no guarantee that a .jpg file is actually a JPEG image, it could be just misnamed).

the file size you could get if your broser supports the FileReader API.
Oct 27 '13 #2

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

Similar topics

0
by: Dhanasankar S via DotNetMonster.com | last post by:
Hai friends, Please give me an idea to read the content in the body part of a HTML file from another HTML file using Javascript. -- Message posted via http://www.dotnetmonster.com
6
by: Vikram | last post by:
I have added some input elements on a page using javascript at client side. when i submit the page, i am unable to access the values of input elements created using request.form. Are elements...
0
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1-...
1
by: datttanand | last post by:
hello everybody, How to read a MS Word File using javascript? I want to read some data from existing file and wants to append it to my new word file, can anybody tell me how to do tjis with...
3
by: hpandya | last post by:
Can i call php file in Javascript file,? or how can call php functions in javascript file ? Please help me out here Thanks, Harsh
1
by: Nelson Joseph | last post by:
Hai all, I would like to create an XML file using JavaScript. Is it possible? Please tell me how can we create? Thanks in advance. - Nelson
2
by: subhash123 | last post by:
Hi All, Any one knows how to print pdf file using JavaScript. Please Suggest...
1
by: moose hoss | last post by:
How would I validate this select box using JavaScript? <form action="pizza/data.php" method="post" name="form" onsubmit="javascript:return form_validation();"/> <select name="team"...
1
by: Kurri | last post by:
How to get the text from many CSS files and merge them into one file using javascript to avoid overhead at server side. Using C# or ASP.NET or Javascript or JQuery....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.