How to restrict Shiny fileInput to text files only?

Davit Sargsyan

I want to restrict my file browser to displaying only the types of file I specify, e.g. .txt files only. The only relevant snippets of a code I found are like the following:

fileInput("in_file", 
          "Input file:",
          accept=c("txt/csv", "text/comma-separated-values,text/plain", ".csv") 

However, this does't filter the files showing in the browser to just .txt and .csv. Any ideas?

DeanAttali

As far as I understand, that's the right way to do it. If you view your app in the RStudio viewer it wouldn't do anything, but in a browser it should. I'm using Chrome and I just ran that code and it did in fact only show me txt and csv files.

Of course the user can still choose to view other files by going to the little select box and choosing to view all files, but they have to consciously choose to do that. By default only csv and txt files will be shown

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

fileInput函数在R Shiny中不响应

来自分类Dev

R Shiny: fileInput, NULL appearing at end of str() console output

来自分类Dev

仅在将fileInput加载到Shiny中时显示sliderInput

来自分类Dev

How to restrict website for SSL only on production but keep working without ssl locally

来自分类Dev

如何将Shiny fileInput限制为仅文本文件?

来自分类Dev

通过fileInput重置Shiny应用程序(当用户浏览新数据时)

来自分类Dev

How to upload only pdf files in PHP

来自分类Dev

Gulp: how to watch multiple files and perform a task for only the changes files?

来自分类Dev

How to correctly determine character encoding of text files?

来自分类Dev

How to split text between separator into multiple files?

来自分类Dev

在没有用户交互的情况下,如何更新R Shiny中与`fileInput`变量相关的文件?

来自分类Dev

How to get perforce to pull only files that don't exist in workspace

来自分类Dev

How to use shiny conditional panel

来自分类Dev

How to make Shiny redirect immediately?

来自分类Dev

来自fileInput的多个selectizeInput

来自分类Dev

来自fileInput的多个selectizeInput

来自分类Dev

How to git-add only non-whitespace changes and new files?

来自分类Dev

R反应表达式中的Shiny和Shiny Files错误

来自分类Dev

How to restrict linux user to absolute minimal commands for SSH

来自分类Dev

fileinput.Fileinput.read()函数用于整个文件

来自分类Dev

fileinput.filename()如何工作?

来自分类Dev

last modified files only moved ansible?

来自分类Dev

How to give validation to each text box which should take only one character or digit using asp.net mvc 4

来自分类Dev

Select only elements who directly contain text

来自分类Dev

Fastest way to upload text files into HDFS(hadoop)

来自分类Dev

TStringList.LoadFromFile - Exceptions with Large Text Files

来自分类Dev

Trying to switching text between 2 files

来自分类Dev

yii2中的kartik fileinput错误

来自分类Dev

闪亮的fileInput不保留文件名

Related 相关文章

  1. 1

    fileInput函数在R Shiny中不响应

  2. 2

    R Shiny: fileInput, NULL appearing at end of str() console output

  3. 3

    仅在将fileInput加载到Shiny中时显示sliderInput

  4. 4

    How to restrict website for SSL only on production but keep working without ssl locally

  5. 5

    如何将Shiny fileInput限制为仅文本文件?

  6. 6

    通过fileInput重置Shiny应用程序(当用户浏览新数据时)

  7. 7

    How to upload only pdf files in PHP

  8. 8

    Gulp: how to watch multiple files and perform a task for only the changes files?

  9. 9

    How to correctly determine character encoding of text files?

  10. 10

    How to split text between separator into multiple files?

  11. 11

    在没有用户交互的情况下,如何更新R Shiny中与`fileInput`变量相关的文件?

  12. 12

    How to get perforce to pull only files that don't exist in workspace

  13. 13

    How to use shiny conditional panel

  14. 14

    How to make Shiny redirect immediately?

  15. 15

    来自fileInput的多个selectizeInput

  16. 16

    来自fileInput的多个selectizeInput

  17. 17

    How to git-add only non-whitespace changes and new files?

  18. 18

    R反应表达式中的Shiny和Shiny Files错误

  19. 19

    How to restrict linux user to absolute minimal commands for SSH

  20. 20

    fileinput.Fileinput.read()函数用于整个文件

  21. 21

    fileinput.filename()如何工作?

  22. 22

    last modified files only moved ansible?

  23. 23

    How to give validation to each text box which should take only one character or digit using asp.net mvc 4

  24. 24

    Select only elements who directly contain text

  25. 25

    Fastest way to upload text files into HDFS(hadoop)

  26. 26

    TStringList.LoadFromFile - Exceptions with Large Text Files

  27. 27

    Trying to switching text between 2 files

  28. 28

    yii2中的kartik fileinput错误

  29. 29

    闪亮的fileInput不保留文件名

热门标签

归档