Citation :
url = "\\serveur\repertoire1\repertoire2\;
File newFichierServer = new File(url);
..
public static void copyFile(InputStream uploadInStream, File newFichierServer) throws IOException {
byte[] buffer = new byte[8192];
FileOutputStream fOut = new FileOutputStream(newFichierServer);
int c = 0;
while ((c = uploadInStream.read(buffer)) != -1) {
fOut.write(buffer, 0, c);
}
fOut.flush();
fOut.close();
}
...
newFichierServer.setReadOnly();
|