开发者

Cannot write image to a directory on my website

Im trying to write a file to my server. I set all permissions on the folder to allow me to write files to a specific directory, however I'm getting the following error when tr开发者_JAVA技巧ying to save an image to the directory.

org.apache.jasper.JasperException: access denied 
           (java.io.FilePermission {MyDirectory/myImage.png delete)

Now, I have permission to read/write/execute to the folder, I am not trying to delete the file, however I see "delete" listed in the issue above.

I'm using a shared hosting solution, but I set the permissions on the directory to allow me to write to it, so I'm not sure what the issue is. Here is the line of code that is giving me the problem.

javax.imageio.ImageIO.write(bufferedImage, "PNG", filOutput);

Any thoughts on how to solve this?


JasperReports may be running as a different user than Apache. So ensure that your JasperReports user has the correct permissions to read/write files to that particular directory.

Even try doing it manually from the command line to verify the correct permissions for the JasperReports user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜