BlazeDS/ FLEX - 上传图像并显示
我正在开发一个 FLEX,它使用户能够浏览服务器上的图像列表(BalzeDS tomcat 4.0.0.14931)。存储在“WebContent/Images”下的图像以及已经可用/保存的图像将根据需要显示。
从此应用程序中,用户可以从本地目录中选择文件并上传。我已经完成了与上传图像相关的必要编码,并且它成功地在服务器上的所需文件夹中创建了一个副本。上传图像文件后,我尝试在 FLEX 端显示它,但图像未显示。在服务器端查看目标文件夹,文件已经创建成功。
为了使上传的图像可见,必须重新启动 BlazeDS Tomcat 服务器。由于这不是理想的继续方式,我正在寻求各位专家的帮助来解决这个问题。
我尝试在网上搜索解决这个问题,但无法找到任何解决方案。另一个论坛上发布了相同的问题(Tomcat 重启问题),仍然没有解决。
我这是实现 JAVA/ BlazeDS/ TomCat/ FLEX 环境的最佳方法,或者是否有更好的替代方案。我可以实现此目的的另一种选择是通过将文件作为 byte[] 持久保存到数据库中,但我不想以这种方式完成,因为数据库的大小往往会增加。
如果您能帮我解决这个问题,我将非常感激。
提前致谢。
I'm working on a FLEX which enables the user navigate through a list of images at the server (BalzeDS tomcat 4.0.0.14931). The images stored under the "WebContent/Images", and the already available/ saved images are displayed as desired.
From this app user would be able to select a file from their local directory and upload it. I have done the necessary coding related with uploading the image and it successfully creates a copy at the desired folder at the server. Once the image file is uploaded I'm trying to display the it at the FLEX end, but the image is not displayed. When check at the target folder at the server end, the file has been created successfully.
In order to make the uploaded image visible, the BlazeDS Tomcat server has to be restarted. Since this is not desired way to go ahead, I am seeking some help from you experts out there to resolved this.
I tried searching the net get this issue sorted out, but unable to come cross any solution. An identical issue was posted on another forum (Tomcat restart problem), that also still not resolved.
I this is best approach to achieve this JAVA/ BlazeDS/ TomCat/ FLEX environment or is there a better alternative. The other alternative I could achieve this is through persisting the file into the database as byte[], but I did not want accomplish in that manner since size of the database tend to shoot up.
I would really appreciate if you could help me out on this.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您必须重新启动 Tomcat,则意味着您正在将用户数据存储在 web-apps 目录中。您不应在 webapps 文件夹中存储任何用户数据。这些被视为“系统文件”,在任何情况下都不应公开编辑。
将任何用户数据存储在具有正确权限的可公开访问的文件夹中,并通过 HTTP 提供它们(您应该能够在 Web 浏览器中查看它)。
If you have to restart Tomcat, that means you are storing user data in your web-apps directory. You should not be storing any user data in the webapps folder. These are considered "system files" and should not be publicly editable under any circumstance.
Store any user data in a publicly accessible folder with the correct permissions and serve them over HTTP (you should be able to view it in a web browser).