question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with KFiles

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rjaroscommented, Jun 5, 2019

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 in utils package: Form<K>.getDataWithFileContent() or FormPanel<K>.getDataWithFileContent().

0reactions
robert-cronincommented, Jun 6, 2019

I didn’t have much success with FileReader, perhaps it’s worth checking out again, I didn’t know about that method

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found