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.

[bootstrap-4] File uploads result in error ".file should match format "data-url""

See original GitHub issue

Prerequisites

Description

Using the bootstrap-4 theme, submitting a file triggers an error:

.file should match format "data-url"

Steps to Reproduce

  1. Playground link
  2. Click “Choose file” for the first file upload
  3. Select any file from your computer
  4. Click “Submit”

Expected behavior

No errors are displayed.

Actual behavior

The following error is displayed:

.file should match format "data-url"

Version

master

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
tjuravichcommented, Feb 3, 2021

@Hasenn I worked around it using this:

I first created a widget in my repo called BootstrapFileWidget and reference the FileWidget from core:

import React from "react";
import FileWidget from "@rjsf/core/dist/cjs/components/widgets/FileWidget";

const BootstrapFileWidget = (props: any) => {
  return (
    <>
      <FileWidget {...props} type="file" />
    </>
  );
};

export default BootstrapFileWidget;

Then i popped that into the widgets

const widgets = {
  file: BootstrapFileWidget,
};

Then, made sure my file was using that widget:

const uiSchema = { file: { "ui:widget": "file" } }

Not the cleanest workaround, but it got me up in running in a few minutes

1reaction
epicfaacecommented, Sep 9, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

bootstrap 4 file input doesn't show the file name - Stack Overflow
I have a problem with the custom-file-input class in Bootstrap 4. after I chose which file I want to upload the filename do...
Read more >
Bootstrap File Input Options - © Kartik - Krajee JQuery Plugins
All the options to the bootstrap file input plugin can be passed ... This will display the upload statistics typically below the file...
Read more >
File Upload With Bootstrap File Input - CodePen
Bootstrap File Input is a field which the user can use to upload one or more files (photos, documents or any other file...
Read more >
Visual CUT User Manual - Millet Software
The first export file extension should match the export format selected for the ... Visual CUT would export the reports directly to shared...
Read more >
convert image file to base64 js Code Example - Code Grepper
function dataURLtoFile(dataurl, filename) { var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, ...
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