473,473 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

uploaded file-size validation

sumittyagi
202 Recognized Expert New Member
If we want to upload file, we you the tag:
<input type="file" name="fileName"/>

Now is it possible to get the size of the uploaded file before submitting it.(at onsubmit)

or we would have to do that at server side only.
Mar 5 '07 #1
4 6307
acoder
16,027 Recognized Expert Moderator MVP
Welcome to The Scripts.

You've just joined and you're getting stuck in - it's good to see!

One thing is you should not double post. Actually, starting a new thread as you have done is here was the correct way to go.

The answer to your query which I answered in the other thread too is that only IE supports the fileSize property.

In any case, you will need server side code for file size checking in case someone disables javascript or uses some other method to bypass your security checks on the client-side.
Mar 5 '07 #2
sumittyagi
202 Recognized Expert New Member
Welcome to The Scripts.

You've just joined and you're getting stuck in - it's good to see!

One thing is you should not double post. Actually, starting a new thread as you have done is here was the correct way to go.

The answer to your query which I answered in the other thread too is that only IE supports the fileSize property.

In any case, you will need server side code for file size checking in case someone disables javascript or uses some other method to bypass your security checks on the client-side.

Thanks for your reply acoder. And I am sorry for double posting! I will remember this in my future posts.
Mar 5 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Thanks for your reply acoder. And I am sorry for double posting! I will remember this in my future posts.
No problem.
Mar 5 '07 #4
sparkyfied
1 New Member
Sorry to throw a spanner in the works...

As far as I am aware, once the file has been selected you can do an onchange event on the file field, create a image object in js, give the image object the source (in the file field) .src, and then do some tests using javascript. You should be able to attach an onload event to the image to check it's loaded before getting the heights and widths, although I'm not sure if that is frowned upon these days.

Hope that helps.
Mar 5 '07 #5

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

Similar topics

2
by: ketulp_baroda | last post by:
Hi I want to determine the content type of uploaded file. File was uploaded by using <input type=file>. How can I determine the content type?
0
by: Mark | last post by:
Hi all, I want to be able to resize an image that a user has uploaded. I have the image upload working as well as the image resize. When I go to delete the original uploaded file (I want to...
8
by: Al Knowles | last post by:
I have researched and tried every method I can find for passing a two-page tif file from a VB6 application to a web service via XML. These include XMLTextReader.ReadBase64, Convert.FromBase64,...
1
by: j | last post by:
Hi, I've been trying to do line/character counts on documents that are being uploaded. As well as the "counting" I also have to remove certain sections from the file. So, firstly I was working...
5
by: IkBenHet | last post by:
Hello, I use this script to upload image files to a folder on a IIS6 server: ******************* START UPLOAD.ASPX FILE ********************** <%@ Page Language="VB" Debug="true" %>
4
by: riteshjain82 | last post by:
Hi, Please go through this: I am having a file (default.asp) on which i am taking many details from a user before mailing it to someone. I have also provided the user with a facility of...
6
by: Kimmo Laine | last post by:
Running IIS 6 on Windows 2003 server. After an update to the most recent version of php 5.1.2, for some reacon a function handling uploaded files using is_file stopped working. is_file failed...
2
by: Greg | last post by:
I need to create an aspx page that accepts an uploaded text file from a user and parses the file contents into various, normalized database tables/columns. The input file is an industry standard,...
2
by: Muddasir | last post by:
Hi All. Anyone plz tell me how can I upload a file with the file name of my choice. am having problem with this, the file got uploaded but not with the name I wanted to...how can I do this...
14
by: Jeigh | last post by:
Hello, I'm going to start making a script that will allow users to upload a file, then re download it later. I'll basically be doing the following: - The uploaded file will be given a string of...
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.