• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Check file size with Javascript before uploading

 
Greenhorn
Posts: 29
Netbeans IDE Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


this code is not working, i click the size button nothing is happen i checked ActiveXObject is not working
i am using IE
what is the reason for this
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of IE are we talking here: IE6, IE7, IE8, IE9
Is there an error message?
Do you have ActiveX enabled since this is a security risk accessing the file system?

Eric
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey satheesh,
I tried your code and it did not run in firefox in the begining, later i tried it in internet explorer which asked me to allow the Active X controller to run...
once i allowed the activeX controller in IE and then selected a file i got some output of 13 bytes...

Your code works fine.......

Try to enable the ActivX controller
 
satheesh subramani
Greenhorn
Posts: 29
Netbeans IDE Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi anirudh

i try to enable the activex control for the following steps

Open Internet Explorer
Select Tools
Select Internet Options. Internet Options window should open up.
Select Security tab.
Select "Custom Level" button. The Security Settings window should open up.
Find the "Download signed ActiveX controls" from the list that appears and select "Prompt" radio button.
Find the "Run ActiveX controls and plugins" in the list and select "Enable" radio button.
Click on OK button twice to save changes
Close Internet Explorer and open it again.


but it not working i click the size button, in status bar of IE shows error on page
i am getting the error automation server can't create object

 
anirudh jagithyala
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to use some other upgraded IE like IE6,IE7 etc...
which IE are you using....?
 
satheesh subramani
Greenhorn
Posts: 29
Netbeans IDE Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IE 7
 
anirudh jagithyala
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to experiment with other options in the security tab....
Mostly this error would be due to "Initializing and Script Activex controls not marked as safe"-----

if that doen't work try out this

http://forums.devx.com/showthread.php?threadid=5092
 
satheesh subramani
Greenhorn
Posts: 29
Netbeans IDE Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any other method to find the file size before uploading

i think this method is not efficient because we check the system whenever the application is running
so suggest any other method with in application
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

satheesh subramani wrote:i am getting the error automation server can't create object



That error normally means your security settings are set too high still.

BUT just think, if you are having this much trouble, imagine what your users are going to go through. It is not worth it.

Eric
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic