applet within browser not releasing file resource

hi,

I have an applet for ftp images upload.

run from eclipse IDE (which uses applet viewer) the applet is ok.

if i run my applet from browser here is what happens:

i upload a file .& leave the browser opened.

i then open this same file with gimp or photo-shop & getfile in use error.

if i close browser & try opening file .it works ok.

why the file isn't released when applet instance still on browser ?

is there a fix to this issue ?

thanks for helping .

[537 byte] By [Servant@AKa] at [2007-11-27 11:33:20]
# 1

> why the file isn't released when applet instance

> still on browser ?

First assumption: you don't close the stream.

CeciNEstPasUnProgrammeura at 2007-7-29 16:50:41 > top of Java-index,Java Essentials,Java Programming...
# 2

Do you close all the streams etc.? Show some relevant code.

-Kayaman-a at 2007-7-29 16:50:41 > top of Java-index,Java Essentials,Java Programming...
# 3

thanks for prompt reply.

yes i close all streams...

the core method i use to upload files is below (client is a FTPClient object)

private synchronized void putFile(File file, String remoteFile)

throws FileUploadException {

String sFile = null;

try {

sFile = r.chomp(remoteFile, '/');

client.put(file.getAbsolutePath(), sFile + file.getName());

r.numBytes += file.length();

} catch (Exception e) {

//e.printStackTrace();

try {

retry(file, sFile);

} catch (Exception e1) {

throw new FileUploadException(e1.getMessage());

}

}

}

what am i doing wrong ?

Servant@AKa at 2007-7-29 16:50:41 > top of Java-index,Java Essentials,Java Programming...
# 4

Hi ,

i went through my code to detect the source of this obscure problem

I'm sure i don't open any stream at all .I'm only using java File Object & this one doesn't need to be closed or disposed in someway. am i right ?

if this is true ,what other operation could cause this locking issue ?

i appreciate your help on this.

thanks.

Servant@AKa at 2007-7-29 16:50:41 > top of Java-index,Java Essentials,Java Programming...