int separatorPos = name.lastIndexOf("_");
final String pid = name.substring(0, separatorPos);
final Upload uploadComponent = (Upload) idPaintableMap
.get(pid);
if (uploadComponent == null) {
throw new FileUploadException(
"Upload component not found");
}
if (uploadComponent.isReadOnly()) {
throw new FileUploadException(
"Warning: ignored file upload because upload component is set as read-only");
}
synchronized (application) {
// put upload component into receiving state
uploadComponent.startUpload();