简体   繁体   English

播放Framework 1.4 staticDir路线

[英]Play Framework 1.4 staticDir routes

I need to save amount of images sent by users in a specific directory, then render this images 我需要将用户发送的图像数量保存在特定目录中,然后呈现此图像

I'm trying to use the staticDir routes, like this: 我正在尝试使用staticDir路由,如下所示:

GET     /test/*                                staticDir:/var/www/images

but when I access the url http://localhost:9000/test/test.png the response is 'not found' 'the file /var/www/images/test.png does not exist' 但是当我访问URL http:// localhost:9000 / test / test.png时 ,响应未找到'文件/var/www/images/test.png不存在'

but the file exists in this path 但是该文件存在于此路径中

somebody knows what is wrong? 有人知道怎么了吗?

thanks 谢谢

Play's staticDir can only route to dir under the project root. Play的staticDir只能路由到项目根目录下的dir。 /var/www/images looks like a system level path. /var/www/images看起来像系统级路径。 You can probably set a symbol link from there to an image folder inside your project home 您可能可以从此处设置到项目主页中的图像文件夹的符号链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM