aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Check file size with Javascript before uploading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Check file size with Javascript before uploading" Watch "Check file size with Javascript before uploading" New topic
Author

Check file size with Javascript before uploading

satheesh subramani
Greenhorn

Joined: Jan 03, 2011
Posts: 29



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
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
anirudh jagithyala
Ranch Hand

Joined: Dec 07, 2010
Posts: 41
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

Joined: Jan 03, 2011
Posts: 29

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

Joined: Dec 07, 2010
Posts: 41
try to use some other upgraded IE like IE6,IE7 etc...
which IE are you using....?
satheesh subramani
Greenhorn

Joined: Jan 03, 2011
Posts: 29

IE 7
anirudh jagithyala
Ranch Hand

Joined: Dec 07, 2010
Posts: 41
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

Joined: Jan 03, 2011
Posts: 29

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
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Check file size with Javascript before uploading