// if the user isn't logged in then make sure that anonymous
// uploads have been enabled
if ( user == null )
if ( !p.get(Constants.WWW_UPLOADS_ALLOW_ANONYMOUS).equals(Properties.YES) )
throw new BadRequestException( locale.getString("www.error.noAnonymousUploads"), 403 );
// check there is a valid collection set for uploads
final Database db = getDatabase();
final String uploadsPath = Utils.getUploadsPath( db, p );
if ( uploadsPath.equals("") )
throw new BadRequestException( locale.getString("www.error.noUploadsDirectory"), 500 );
final File uploadsDir = new File( uploadsPath );
if ( !uploadsDir.canWrite() )
throw new BadRequestException( locale.getString("www.error.uploadsDirNotWritable"), 500 );
}