Non riesco ad effettuare una scrittura di un file su un server. Il codice che utilizzo è il seguente:

codice:
 
URL u=new URL("user:pasw:ftp.serv.it/dir/file");
URLConnection uc=u.OpenConnection();
uc.setDoOutput(true);
uc.connect();
OutputStream o=uc.getOutputStream(); \\ riga che genera errore
o.write(buf,0,64); \\buf è un array di byte
o.flush();
o.close();
L'errore che viene generato è il seguente: PROTOCOL DOESN'T SUPPORT OUTPUT.

Qualcuno mi sa spiegare dove sto sbagliando?