Click to See Complete Forum and Search --> : image previewer, security issues?


sneakyimp
03-06-2006, 05:33 PM
i have a site that lets users upload images. i want to let them preview the image they have selected before they hit 'submit' on the form. to effect this, i have added an onChange function to the file input on my form. when the user selects a file, i would like to preview the file on the html form.

the problem i'm having is that HTML files hosted from my site cannot display local files for security reasons. or, more specifically, it works fine in Internet Explorer but not in firefox and possibly other browsers due to security protections.

SO, i thought i would create a Java applet to do the image preview....but then i saw this warning on the SUN site:


Note: For security reasons, browsers limit the URLs from which untrusted applets can read. For example, most browsers don't allow untrusted applets to use ".." to get to directories above the code base or document base. Also, since untrusted applets can't read files except those on the applet's originating host, the document base isn't generally useful if the document and the untrusted applet are on different servers.


Before I go through the trouble of learning to code this thing in java, can someone tell me if i will still have security issues? Can I write a java applet that can add my site to a user's safe list? will that solve the security issue?