Accessing uploaded file


How to access with FileReader a file which was uploaded into temporary storage in web client?

  1. I put a fileupload field in an empty screen.
  2. Uploaded a csv file.
  3. In upload success listener i get a filedescriptor object
    How to pass this file to a Filereader? I need process a CSV file uploaded this way.
    The file is not needed at all after the processing, so I will clear the temporary storage after processing.

BTW i tried use FileStorageService too but it cannot be injected into screen controller at all…


Hi Sandor,
The FileUploadingAPI interface has the getFile() method that returns File object for a given temporary file id, which can be obtained from FileUploadField. So the following should work:

File tmpFile = fileUploadingAPI.getFile(uploadField.getFileId());
1 Like