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.
|
|
|
|
|
![]() |
||
Finding Upload file size - Javascript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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 |
|
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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)
|
![]() |
| Tags |
| finding, upload, file, size, javascript |
| Thread Tools | |
|
|
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 |