t) Verify that component uploads the file and the statistics are shown correctly (E5100175)

i) Steps

  1. new project
  2. drag a basic > static text on to the designer and label it 'Download a File', set the style/font to something large.
  3. drag a basic > file Upload component onto the designer and label it 'Select a File: ' (Skip label due to bug!)
  4. drag a basic > button onto designer and label it 'Upload File Now'
  5. drag a basic > textArea on to designer, and label it 'Contents of File:', set the columns to 60 and the rows to 5.
  6. drag a basic > messge Group onto the designer
  7. double click the button and add the following source (merge: com.sun.web.ui.model.UploadedFile;)

    UploadedFile uploadedFile = (UploadedFile) fileUpload1.getUploadedFile();
    info("Uploaded file originally named '" +
    uploadedFile.getOriginalName() +
    "' of size '" +
    uploadedFile.getSize() +
    " ' " );
    textArea1.setText(uploadedFile.getAsString());


  8. Right click and do Fix Imports
  9. deploy/run the application
  10. browse and select a file
    1. Be sure to test files with space in path, space in name, as well as ones without.
    2. The src folder under this folder contains a series of files that can be used.
  11. press the Upload File Now button

o) expected results

  1. The textArea should display the contents of the file.
  2. The message group should display the name and size of the file.
  3. Repeat at least 2 times
  4. Note for manual testers!: Be sure to test when fileUpload has a lable, and when it doesn't. 6366690

On the EA forum, 2 users have reported, and I have verified, that file1.getUploadedFile() returns null when using IE. I know it isn't on your radar yet (because of Gregory's list) but when it is you might want to check it out.

Logged as 6330658.