【发布时间】:2018-07-05 12:46:45
【问题描述】:
我对 R Shiny 的 fileInput 有一些问题。默认情况下,大小限制设置为 5MB。
由于我必须处理的文件非常大(> 50GB),我只需要文件的数据路径和/或名称。不幸的是 fileInput 想要上传完整的文件,或者至少它正在以某种方式加载文件并告诉我在我达到 5MB 限制后文件太大了。
我怎样才能只交出我的应用程序的路径而不上传文件?
ui.R
library(shiny)
# Define UI ----
shinyUI(fluidPage(
h1("SAS Toolbox"),
tabsetPanel(
tabPanel("SASFat",
sidebarPanel(h2("Input:"),
actionButton("runSASFat","Run Job",width="100%",icon("paper-plane"),
style="color: #fff; background-color: #337ab7; border-color: #2e6da4"),
wellPanel(
#tags$style(".shiny-file-input-progress {display: none}"),
fileInput("FEInp","Pfad FE input Deck:"),
fileInput("FERes","Pfad FE Results:")
),
wellPanel(
checkboxGroupInput("options1","Auswertung:",c("Grundmaterial","Schweissnähte")),
conditionalPanel(condition="$.inArray('Schweissnähte',input.options1) > -1",
sliderInput("filter", "Filter:", 0.75, min = 0, max = 1))
),
wellPanel(
radioButtons("solver", "Solver:", c("Ansys","Abaqus", "Optistruct")),
conditionalPanel(condition="input.solver == 'Ansys'",selectInput("lic", "Lizenz",c("preppost","stba","meba")))
),
wellPanel(
checkboxGroupInput("options2","Optionen:",c("Schreibe LCFiles"))
)
),
mainPanel(br(),h2("Output:"),width="30%")
),
tabPanel("Nietauswertung"),
tabPanel("Spannungskonzept EN12663")
)
))
server.R
# Define server logic ----
shinyServer(function(input, output) {
observeEvent(input$runSASFat, {
FEInp <- input$FEInp
FERes <- input$FERes
opt1 <- input$options1
opt2 <- input$options2
filter <- input$filter
solver <- input$solver
lic <- input$lic
write(c(FEInp$datapath,FERes$datapath,opt1,opt2,filter,solver,lic),"ghhh.inp")
})
})
提前致谢
迈克尔
【问题讨论】:
-
我没有用闪亮测试过这个,但也许
file.choose()会有用吗?