The Artima Developer Community
Sponsored Link

Java Answers Forum
How can I allow a user (client) to choose a local image file (on his hard d

3 replies on 1 page. Most recent reply: Jul 5, 2003 3:57 AM by zenykx

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ken

Posts: 2
Nickname: ken2002
Registered: Jun, 2003

How can I allow a user (client) to choose a local image file (on his hard d Posted: Jun 15, 2003 10:22 AM
Reply to this message Reply
Advertisement
How can I allow a user (client) to choose a local image file (on his hard drive) and modify it using an applet from his browser ? I am trying to develop a web page that enables the user to choose an Image file, manipulate the image using a java applet, and display the results.

Using Java’s “JFileChooser” does not work when called from a browser, probably due to security privileges issues. On the other hand, I can choose and upload any file using a JavaScript form:
...
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="process.asp">
<INPUT TYPE=FILE NAME="file1"><BR>
…

It seems that I can choose an image file with a Java script form and process an image with an applet. How can I choose a file AND process it locally ?

(I do not wish to upload the file to the server using JavaScript form and then back to the client’s applet for processing since it will be a tremendous waste of resources).

Will appreciate any solution.

Thanks !

( my email is: sendtoken2002@yahoo.com )


Deepak

Posts: 3
Nickname: deeps
Registered: Jun, 2003

Re: How can I allow a user (client) to choose a local image file (on his hard d Posted: Jun 23, 2003 4:19 PM
Reply to this message Reply
Man this is bcoz you don't have the permission to do that
You need to specify the security permissions. I hope you know how to apply permissions. If not plz let me know, I will help you out. Bcoz I have done the same thing

Ken

Posts: 2
Nickname: ken2002
Registered: Jun, 2003

Re: How can I allow a user (client) to choose a local image file (on his hard d Posted: Jul 4, 2003 7:49 PM
Reply to this message Reply
Can I do that without signing an applet ? Is there a way I can read the form post data (which includes the file) into the local applet ?

Thanx

zenykx

Posts: 69
Nickname: zenykx
Registered: May, 2003

Re: How can I allow a user (client) to choose a local image file (on his ha Posted: Jul 5, 2003 3:57 AM
Reply to this message Reply
Look at jakarta for fileupload project. It is just meant for this.

Flat View: This topic has 3 replies on 1 page
Topic: pls help I'm desparate - still new in Java Previous Topic   Next Topic Topic: Servlet - Applet Communication

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use