wood burning stoves 2.0*
The moose likes Applets and the fly likes Applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets" Watch "Applets" New topic
Author

Applets

Manoj Paul
Ranch Hand

Joined: Jan 18, 2007
Posts: 112
Hi friend
Can anyone help me out with codes for uploading an image file in the server from my Applet page?

I need help in developing an applet which while execution will ask the user to upload his/her image... PLiz send me some codes for developing such an applet application..
Thank you friends
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41604
    
  55
First of all the applet needs to be allowed to access the local filesystem. The HowCanAnAppletReadFilesOnTheLocalFileSystem FAQ page describes the two principal ways to do that.

How to proceed then depends on what kind of server you have. If it's FTP, then you do the upload via Commons Net. If it's HTTP (i.e., a servlet will receive the file), then you need Commons HttpClient in the applet, and Commons FileUpload in the servlet.

All these libraries are linked in the FileUpload FAQ page


Ping & DNS - my free Android networking tools app
patric
Greenhorn

Joined: Apr 12, 2007
Posts: 1
hello ranchfolk,

I installed the
File Upload Applet http://sourceforge.net/projects/jupload/ and played aroung a little bit.

still, I could not make the parameter "postURL" work because I don't know how to apply it's syntax: http://localhost:8080/jupload/pages/parseRequest.jsp?URLParam=URL+Parameter+Value

I tried <PARAM NAME = "postURL" VALUE ="http://localhost:8080/jupload/pages/parseRequest.jsp?URLParam=http://localhost:8080/jupload/uploaded">

but this doesn't work.

does someone know how to apply the syntax 'URLParam=URL+Parameter+Value'?

thank you a lot.

pj
[ April 15, 2007: Message edited by: patric ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41604
    
  55
Hello "patric"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, the javadocs for UploadPolicy state that " It contains the target URL toward which the files should be upload." So in your case I'm guessing that it might be something like "http://localhost:8080/jupload/pages/parseRequest.jsp", or wherever the server component is installed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applets