users@glassfish.java.net

Re: servlet 3.0_at_glassfish v3 - fileUpload completely broken?

From: Dominik Dorn <dominik.dorn_at_gmail.com>
Date: Wed, 14 Apr 2010 10:58:58 +0200

thx alexis, very kind of you ;)

Well, it's not working 100% correctly IMO... if I'm using the following code
        String newFileNamePath = "/home/domdorn/skriptum/upload/" +
hash.toString();
        File f = new File(newFileNamePath);
        f.createNewFile();
        part.write(newFileNamePath);

it appends newFileNamePath to the path where the file is currently
stored instead
of an absolute path, creating a Path like
/home/domdorn/tmp/glassfish/release/glassfishv3/glassfish/domains/domain1/generated/jsp/skriptum/home/domdorn/skriptum/upload/48ce07c5-75d4-4483-9dc9-f92036eb685e

which then leads to a java.io.FileNotFoundException, because it could
probably create the file but not the parent-directories


I think this is a bug, whose with me?

thanks,
dominik