Finding Upload file size - Javascript

This is a discussion on "Finding Upload file size - Javascript" within the JavaScript Forum section. This forum, and the thread "Finding Upload file size - Javascript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 8th, 2006, 07:50
New Member
Join Date: Sep 2006
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Finding Upload file size - Javascript

Hi All,

Hope I can some clear idea for this post here.

I have used ASP.net 1.1. In that application user can upload the file(any printable document like doc/xls/ppt/pps/jpg/gif etc.,). The user allows to upload a max of 4MB.

But if the user uploads more than 4MB I'll issue a msg. But in slow network, the user needs to wait for much time to upload and even get error msg.

I want to stop from client side itself. Once the user selects the file to upload it shud b checked frm Javascript.

* Is there any way to do achieve this?
* The user should not change security settings in browser, if u suggests some method.
* If it is not possible/meaningful then please tell me the reasons very clearly. So I can stop searching.
* Please note any printable document can be uploaded.

Moderators & Experts please give kind attention.

Thanks
Usha
Reply With Quote

  #2 (permalink)  
Old Sep 8th, 2006, 18:23
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Finding Upload file size - Javascript

You cannot check the upload size in JavaScript. To do so would give you access to file properties and the end-user system which the would break the deliberately built in browser security.

It is possible in IE using an Active-X object but its not cross browser and you don't want to go down that route.
Reply With Quote
  #3 (permalink)  
Old Sep 8th, 2006, 21:01
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Finding Upload file size - Javascript

JavaScript is simple add-on program for browsers. It does not have the capabilities to scour through a users hard drive. I'm sure you imagine the obvious security reasons for this.
Reply With Quote
  #4 (permalink)  
Old Sep 9th, 2006, 11:57
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,612
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Finding Upload file size - Javascript

What you can do is make the limit very clear. And if you can, monitor the upload progress and stop if the file size reaches 4mb even when there's more data to upload.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

Tags
finding, upload, file, size, javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP+SQL+File Upload joshlindem PHP Forum 5 May 10th, 2008 16:48
file upload berry05 Job Opportunities 0 Mar 19th, 2008 19:09
File Upload magiccupcake PHP Forum 1 Jan 22nd, 2007 05:10
File upload djme PHP Forum 4 Jan 11th, 2006 18:25
problems with upload file. djanim8 Classic ASP 5 Dec 13th, 2005 17:33


All times are GMT. The time now is 11:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43