views:

22

answers:

1

Hi,
I need to show the status of file upload to servlet in the browser, how can this be acheived without using any libraries like jquery, what are the various options for doing this and which one is the best?

Best Regards,
Keshav

A: 

Without using any add-ons at all, you can't, at least not in all currently-popular browsers. There are some Flash-based uploaders that can do it, and in some newer browsers there's an HTML5-related file API that could be used. In older browsers (IE), you have no access at all to the client-side filesystem, so your Javascript code won't have any idea of the file size.

Pointy
when an add-on or applet is downloaded the user is asked for the confirmation if he trusts the addon and if he wants the addon to access his system, but in case of gmail or when uploading images i dont get any browser warnings, how does google do it in this case?
keshav.veerapaneni
Uploading and downloading are not the same thing. Uploading doesn't change the user's system. There are security mechanisms in the browser that prevent a site from manipulating a "file" input.
Pointy