我无法通过闪亮的网页中的子目录路径上传图像。
- 我创建了一个名为“ www”的子目录文件夹,并放置了图像。
- 我也尝试过使用URL。
仍然无法正常工作
imageOutput("d",width = 300,height = 500)
output$d <- renderImage({
list(src= "driveaxle.png",filetype = "image/png",)}),deletefile = False}
我无法通过闪亮的网页中的子目录路径上传图像。
仍然无法正常工作
imageOutput("d",width = 300,height = 500)
output$d <- renderImage({
list(src= "driveaxle.png",filetype = "image/png",)}),deletefile = False}
我尝试了您的代码。它需要修改几个区域。 首先,您需要在www文件夹下创建一个名为images的文件夹。还需要从单独的变量中读取文件名。
我尝试过,它看起来像: UI.R
fluidPage(
sidebarLayout(
sidebarPanel(
"This is Sidebar"
),mainPanel(imageOutput("d",width = 300,height = 500)
)
)
)
Server.R
function(input,output) {
output$d <- renderImage({
filename <- normalizePath(file.path('./www/images','studio logo.jpg'))
list(src = filename,contentType = 'image/png',alt = "This is alternate text")
},deleteFile = FALSE)
}
输出如下: