【发布时间】:2021-01-07 02:47:43
【问题描述】:
我想知道是否可以从我的闪亮应用程序的下载文件名中删除 tmp 文件夹目录结构,如果可以,请问如何。 我闪亮的应用程序使用 tempfile() 在 tempdir() 中生成一个文件名,名称的初始部分由输入 (fieldName_f) 给出。这在我的 Windows 计算机上运行良好,例如如果 input$fieldName_f
我想知道是否有办法设置例如请提供一个垃圾路径,以确保文件夹结构不会保存在 downloadHandler 中的文件名中。
谢谢大家!
frmd <- tempfile('report', tmpdir = tempdir(), fileext = '.Rmd')
output$downloadF <- downloadHandler(
#specify a filename to save
filename = function(){
tempfile(paste0(input$fieldName_f, 'Report'), tmpdir = tempdir(), fileext = '.html')},
content = function(file){
# Copy the template r markdown file to a temporary directory before processing it
file.copy('reportF.Rmd', frmd, overwrite = T)
rmarkdown::render(frmd, output_file = file)
}
)
【问题讨论】: