Skip to content

File Upload: Add preview/summary for non-text files #826

@mturley

Description

@mturley

As part of implementing the File Upload component in patternfly/patternfly-react#3865, I was asked how it could be used to upload a non-text file (specifically, a zip file). Since the component includes a textarea for the file contents, the only solution currently is to hide the textarea and provide no preview or summary for an uploaded non-text file, or to have the consumer implement their own custom preview or summary.

Initially I implemented a generic summary for non-text files that could be used by default, but I removed it before merging that PR so we could revisit its design and core implementation first. This is what my initial version looked like:

Screenshot 2020-03-09 14 10 09

Basically, the idea is to show something useful based on only the data we know about a selected file before reading it: filename, type, size, and last modified date/time.

cc @mcarrano @christiemolloy

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions