Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f7File: show error message when file exceeds max size #199

Open
Tixierae opened this issue Jun 30, 2021 · 4 comments
Open

f7File: show error message when file exceeds max size #199

Tixierae opened this issue Jun 30, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@Tixierae
Copy link

Hi,

f7File currently displays the name of the uploaded file even when it exceeds the max allowed size (5MB by default) making the user believe that the file was accepted whereas in reality it was not.

On the server side, it is not possible to know whether the file was too big or whether no file was uploaded at all: both cases are associated with a NULL input (see MRE below). This makes it impossible to handle the 'too big' case on the server side, e.g., by displaying a custom error message.

So, it would be nice if an error message could be displayed directly in the f7File widget.

Thanks!

library(shiny)
library(shinyMobile)

ui = f7Page(
  f7SingleLayout(
    navbar = f7Navbar(title = "File handling"),
    f7File('up', 'Upload!'),
    actionButton('test','Click me')
  )
)
server = function(input, output) {
  observeEvent(input$test,{
    print(input$up)
  })
}
shinyApp(ui, server)
@dannyvolkaerts
Copy link

Hi @Tixierae,
Seems that nobody can help you with your questions. I also cannot help you on this. I don't even know where to set the max allowed file size - no documentation on that?
But I do have another question which you maybe can answer:
I'm not a programmer but I spent the whole week 'programming' an app which has the core functionality to upload images from my phone to my Google Drive (specific folder). Turns out the f7File function is not working. There is no input$up when I select an image on the device. When I select a file (f.e. from downloaded folder) it does work. Do you have experience with that?

@Tixierae
Copy link
Author

Hi @dannyvolkaerts - in order to maximize your chances of receiving help, I encourage you to file a new issue and to create a minimal reproducible example that highlights the problem you are facing. It will be difficult for anyone to help you without seeing code and what the problem exactly is.

@dannyvolkaerts
Copy link

Hi @Tixierae,

Thank you for the suggestion. I reused your MRE and changed it slightly to explain my point and filed a new issue.

@alexquant1993
Copy link

Hi, I have the same request. If the file exceeds max size, an alert must be shown to the user as it is done with the fileInput function. Currently, if such a file is uploaded, then input$file_upload renders as NULL.

@DivadNojnarg DivadNojnarg added the enhancement New feature or request label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants