Skip to Content
author's profile photo Former Member
Former Member

FileUpload - HTMLB - Help

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

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Jan 27, 2004 at 03:39 PM

    Elam

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

    D

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2004 at 08:51 PM

    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);

             }

         }

    Add comment
    10|10000 characters needed characters exceeded