RinteRface / shinyMobile

shiny API for Framework7 (IOS/android)
https://shinymobile.rinterface.com
407 stars 74 forks source link

f7File not working on Android when uploading image #221

Open dannyvolkaerts opened 2 years ago

dannyvolkaerts commented 2 years ago

I am not a programmer so maybe I overlooked something when trying my shinyMobile app on my Android device.. f7File functionality is not working on Android device when I try to upload an image of the phone. IMG7456.JPG is correctly displayed when I use the function but the input$up is empty when I try to call it server-side.

MRE: `
library(shiny) library(shinyMobile)

ui = f7Page( f7SingleLayout( navbar = f7Navbar(title = "File handling"), f7File("up", "Upload!"), br(), verbatimTextOutput("theinput"), ) )

server = function(input, output) { data <- reactive(input$up) observe( print(data()$datapath) ) output$theinput <- renderText(input$up$datapath) }

shinyApp(ui, server) `

In the MRE after uploading a file/picture/... you will get the path to this file displayed. If the path is not displayed, this means there is no path and so no input$up available and further actions on the input$up will not work. So when you run the app locally on your laptop/PC you will always get a path and the f7File function works. When running the app in shinyapps.io as I did (MREforAndroid) and open the app on an Android device you are able to select files and images on your device. When running the MRE I noticed that uploading a picture taken via Whatsapp is possible but to remain on topic: uploading an image from Album is not possible. I don't think it has something to do with the file size since I took an image of 3,18MB and this was also not possible.

Thank you for your help!