on 01-06-2004 6:51 PM
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
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);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Elam
There is a method getFile() for the IFileParam object which returns the File object
D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.