fileInfo (data type) and uploadedFile (bytes)

fileInfo (Data Type)

The fileInfo datatype is automatically generated for each file that is successfully processed inside the Powerful File Uploader with Dropzone.

You can also access it from the following callbacks:

  • onFileReceivedAction: Triggered when a file is added successfully.

  • onDeleteFileCustomAction: Triggered when a file is removed from the list.

This datatype provides detailed information about the uploaded file and includes the following fields:


🔹 fileName (String)

The original name of the uploaded file. Example: "project_document.pdf"


🔹 fileSizeInKb (Int)

The total file size in kilobytes (KB). Example: 1542 (which means ~1.5MB)


🔹 fileExtension (String)

The file extension without the leading dot (.). Example: "pdf", "mov", "jpg"


🔹 tempUrl (String)

A temporary path pointing to the uploaded file. This URL can be used to preview the file directly within the app:

  • Use it in a Video Player to stream videos.

  • Use it in an Image widget to show photos.

  • Use it in a PDF Viewer to preview documents.

⚠️ Important: This preview functionality does not work on iOS. iOS strictly restricts access to its internal file structure. It doesn't allow direct streaming from the temporary file path. Instead, iOS decrypts and copies the file temporarily for the uploader, which can be slow for large files—especially .mov files.


🔹 mimeType (String)

The MIME type of the referenced file, useful for conditional logic based on file type. Examples:

  • "application/pdf"

  • "video/mp4"

  • "image/jpeg"

Accessing the Real File (uploadedFile)

In addition to the fileInfo object, the onFileReceivedCustomAction callback also provides a second parameter: uploadedFile. This contains the actual file data (ffUploadedFile) in bytes format, ready to be used directly.

This parameter is available so that you can implement your own logic — for example, uploading the file immediately to your backend, storing it in a variable, or processing it in some custom way.

However, it’s important to understand why this uploader doesn’t store the real files in a list by default. As explained here, storing multiple files (even medium-sized ones) as ffUploadedFile objects in memory — such as in a page state list — can cause severe performance issues or crashes, especially in web environments.

That said, if you are absolutely sure that your use case only involves a single file or very small files (a few KB), then you are free to store the real file (uploadedFile) directly and use it as needed.

Last updated