Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing to server from applet

 
Daniel Pearson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to be able to copy a file from the client machine to the server that the applet originated from. I have already signed the applet etc. and have the security problems worked out, but I need help sending the file back to the server.
Any help would be appreciated...
Daniel
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, daniel,
are your client and server from the same machine? Could you let me know to make signed applet? Thanks,
Simon
 
Daniel Pearson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
Client and Server are different machines.
To create a signed applet:
Internet explorer requires a cabinet file (.cab), created using cabarc.
eg.
cabarc -r -p n c:\imageupload\imageuploadapplet.cab c:\imageupload\*.class
then sign the .cab file using signcode
eg.
signcode c:\imageupload\imageuploadapplet.cab
these tools are part of the Microsoft SDK available from the microsoft site.
Netscape however requires a signed jar file
so use the jar tool
eg.
jar cvf c:\imageupload\imageuploadapplet.jar imageupload\*.class
and the jarsigner tool
eg.
jarsigner -storepass pword c:\imageupload\imageuploadapplet.jar certid
these tools can be found in JDK 1.2
If the applet is for internet use, you might need to obtain a certificate from somewhere like verisign, so people know that the applet is authentic.
Thanks,
Daniel
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Daniel,
Thanks for your info. But,
when I type in, it gives me following error:
C:\>jarsigner -storepass pword signedapplet.jar certid
jarsigner error: java.lang.RuntimeException: keystore load: C:\WINDOWS\.keystore
(The system cannot find the file specified)
What is the problem? I did not find the file .keystore in my PC (Window 95).
Thanks
 
Daniel Pearson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
you need to create a keystore first by using something like this...
keytool -genkey -alias "whateverYouWant"
then if you want to add another key you use
keytool -genkey -alias "anotherName" -keystore whateverYouCalledTheKeystore
I think this should work
Daniel
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it, Daniel,
Thanks
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Daniel,

I'm trying to develop an applet that'll do image editing and uploading to a given server. I'm therefore faced with the same problems you had a (long) while ago.

Have you solved your problems since then? Could you give me some leads?

Thanks,
David.
 
Michael Celaya
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm working also with file uploading, but in JSP. I have used the classes that make this posible from here. In this classes you can't give an url like http://myhost/images to save the file in the server. You must use the server's directory(I still haven't used it from a server that is not in my local machine, but this should work).

Notice that the class' main method doesn't allow the request to be null so you should do it from a JSP or servlet page, maybe you know how to work with JSP and applets together...
If you want to use only applets try this one jupload page, I haven't tried, but maybe you want to.

I hope this helps you in some way.
Regards,
Michael.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David, it's been more than two years since Daniel last posted, so he's probably not going to see this message. Feel free to start a new thread and describe what problems you are having, and we'll take it from there.

Given that the earlier discussion mentions the MS JVM, the advice given there is likely obsolete anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic