cancel
Showing results for 
Search instead for 
Did you mean: 

FileUpload - HTMLB - Help

Former Member
0 Kudos

I would like download a file from client to Server machine. I tried using FileUpload HTMLB component.

I am not sure how to read the File after getting getFile - IFileParam..

Can anybody help me out with this..

Any help is appreciated.

Thanks,

Elam

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, there is also an example in the PDK documentation:

public void onLoadFile(Event event) {

FileUpload fu = (FileUpload) this.getComponentByName("myfileupload");

// this is the temporary file

if (fu != null) {

// Output to the console to see size and UI.

System.out.println(fu.getSize());

System.out.println(fu.getUI());

// Get file parameters and write it to the console

IFileParam fileParam = fu.getFile();

System.out.println(fileParam);

// Get the temporary file name

File f = fileParam.getFile();

String fileName = fileParam.getFileName();

// Get the selected file name and write ti to the console

ivSelectedFileName = fu.getFile().getSelectedFileName();

System.out.println("selected filename: "+ivSelectedFileName);

}

}

darrell_merryweather
Active Contributor
0 Kudos

Elam

There is a method getFile() for the IFileParam object which returns the File object

D