Question regarding File Upload

Hi all.

I have a FileUpload component in which a xml file is passed, and I need to obtain the physical path of the file,in order to parse this xml file.How could I achieve this in the receiveUpload method?

Thanks,
Rafael Roque

You need to save the the file on server and work this newly created file.

But the problem still remains,how can I save the file without retrieving its physical path?

	@Override
	public OutputStream receiveUpload(String filename, String mimeType) {
               output = File.createTempFile("my_xml_output","xml");
               return new FileOutputStream(output);
    }
@Override
public void uploadFinished(FinishedEvent event){
    process(output.getPath());
}

Works fine!!Thanks for your support!!

I noticed that the generated file doesn´t keep the ‘xml’ suffix,for example “test.xml” becomes something like ‘test.xml132423xml’,is there a way to handle this?

File.creatFile.createTempFile(originalName.substring(0, originalName.lastIndexOf('.')),".xml");