Problem with KFiles
See original GitHub issueI’m using the KFile form control but I am not able to get any content from the file, it just returns null
, this is also the case if you try to upload a file to the Showcase form tab and then click show data, it just reveals null
for content.
Any ideas on why this might be?
Specifically, I am trying to get either a Base64 or Binary representation of the file
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Fix common issues in Google Drive
If you're having trouble viewing a file in Google Drive, here's how you can try to fix the issue. 1. Wait and try...
Read more >How to Fix File System Error in Windows 10
File System Errors are essentially disk-related errors that may be due to corrupt files, bad sectors, disk integrity corruption, file execution policies, ...
Read more >Use the System File Checker tool to repair missing or ...
Describes how to use the System File Checker tool to troubleshoot missing or corrupted system files in Windows 8.1, Windows 8, Windows 7...
Read more >What Does It Mean When Your File Is Corrupt?
A corrupted file may not open at all, or may show an error if it does. These damaged files are self-contained, meaning they...
Read more >5 Ways to Fix the "These Files Can't Be Opened" Error on ...
Sometimes, when you download an executable file off the internet or transfer files among PCs, Windows may decide to block the file to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
KFile is a special object created to represent uploaded file, and it needs special handling because file upload is an asynchronous operation. It returns null content without it, and it’s not a bug. I’ve described it briefly in the guide: https://kvision.gitbook.io/kvision-guide/part-2-advanced-features/form-controls-guide#client-side-file-handling
You need to use one of suspending extension functions (of course run from any coroutine builder) defined in
kvision-upload
module inutils
package:Form<K>.getDataWithFileContent()
orFormPanel<K>.getDataWithFileContent()
.I didn’t have much success with
FileReader
, perhaps it’s worth checking out again, I didn’t know about that method