我將文件上傳到/upload
文件夾,然後我想直接訪問我的文件,如:路線上傳文件播放框架2.10
http://localhost/upload/xxx.jpg
當我添加如下路線:
GET /upload/*file controllers.Assets.at(path="/upload", file)
它會導致另一個錯誤:
not enough arguments for method at: (path: String, file: String)play.api.mvc.Call. Unspecified value parameter file.
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
然後,以後我改@routes.Assets.at("stylesheets/main.css")
到@routes.Assets.at("stylesheets/", "main.css")
,還有另外一個錯誤:
[MatchError: (stylesheets/,main.css) (of class scala.Tuple2)]
(path: @unchecked, file: @unchecked) match {
有人可以幫我這條路呢?謝謝。
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
playAssetsDirectories <+= baseDirectory/"upload"
)
更多信息: