0

HI can anybody tell me how to create a file and write on it on the URl.

Actually I am using an applet and from theat I want to create a file on getCodebase(); so can any body tell me how can I do it

I have tried

URL url = new URL(/*url by codebase and the directory with file name*/);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
OutputStream out = connection.getOutputStream();

but it not worked

Please help me

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
agarwal_achhnera
  • 2,582
  • 9
  • 55
  • 84

1 Answers1

1

Actually I am using an applet and from theat I want to create a file on getCodebase();

Well that wouldn't be very secure if you could do that, would it?

I think the route you want to take is to configure your HTTP server to handle PUT requests, and then form a PUT in Java. That is described here:

However, your applet probably needs elevated permissions (in other words, a signed applet that operates outside of the normal sandbox). I'm not sure about that though; some connections are allowed back to the host so you might be OK.

Community
  • 1
  • 1
Mark Peters
  • 80,126
  • 17
  • 159
  • 190