1

I need to detect the size of the file before upload.

I need it to work in IE8, thus not HTML5
It needs to be entirely client side.
I need to be able to specify file size limit.

I am aware that ActiveX can be used, but I cannot use that due to it requiring the user to 'permit' it.

I have tested BlueImps plugin, but it doesn't seem to work and the documentation does not seem to state browser support.

Can anyone suggest a plugin/method with fits with my criteria.

8
  • Check this question. It seems to be in plain javascript using the File API, but does not work on IE. Commented Feb 13, 2014 at 9:29
  • @RoyiNamir thanks for your comment. Uploadify would be my preferred alternative. Unfortunately, appears to be dependent on PHP, which the server does not support. Commented Feb 13, 2014 at 9:34
  • @JezD dependent on PHP ??? Commented Feb 13, 2014 at 9:35
  • 1
    Uploadify is not dependent on PHP, you can freely use it with any other server side language. It doesn't do anything more than upload a certain POST request to a certain server-side address. Commented Feb 13, 2014 at 9:36
  • 1
    @RoyiNamir Have just re-read the uploadify docs. Yep, it seems I can post to any serverside uploaded file handler Commented Feb 13, 2014 at 9:38

1 Answer 1

0

If you're willing to introduce a dependency on Flash, then you could use that to get the file size (and handle the upload too).

Flash supports file-selection via the FileReference class, which gives you access to some metadata including the file size.

With some help from the ExternalInterface class, you could call a JavaScript function and give it this information.

You could then upload the file from Flash instead of with the usual input element, if the file size is appropriate.

Check out YUI's uploader for a really easy-to-use and well-documented free component that handles all this for you (you only need to write a little JavaScript, and you can style the pre-built Flash component however you want).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.