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,892
  • 12
  • 51
  • 84
agarwal_achhnera
  • 2,516
  • 8
  • 53
  • 77

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
  • 78,348
  • 16
  • 155
  • 186