Skip to Content
0
Former Member
May 04, 2005 at 11:06 PM

FileUpload and AbstractPortalComponent

17 Views

The following does not seem to find a valid file to upload and isFileParam always returns false. I am using AbstractPortalComponent and the example sin SDN seem to use PageProcessorComponent.

myContext = 
PageContextFactory.createPageContext(request, response);
Event lastEvent = myContext.getCurrentEvent();
if (lastEvent != null) {
	if (lastEvent.getComponentName().equals("submit")) {
	if (myContext.isFileParam("fileUpload"))
		response.write("yep, it's a file parameter");
	else
		response.write("not a file param");
//
//
//
FileUpload file = new FileUpload("fileUpload");
file.setAccept("text/xml");
file.setSize(50);
Label label = new Label("Select XML file with assignments");
gl.addComponent(1, 1, label);
gl.addComponent(1, 2, file);