0

I uploading in my app, images and save them in web-app/myCustomFolderImages. When I want delete some of this images, I'm having 2 problems:

  1. Sometimes when I'm deleting file immediately after upload, I can't do this, javaw.exe blocking file. Something is caching this file?

  2. Major problem, when I delete a file, and upload next, console writes this stack:

Resource reload failed!:
java.io.FileNotFoundException: URL [file:.../z5c2ex/004_1_-thumbnail.jpg] cannot be resolved in the file system for resolving its last-modified timestamp
    at org.springframework.core.io.AbstractResource.lastModified(AbstractResource.java:144)
    at org.springframework.core.io.AbstractFileResolvingResource.lastModified(AbstractFileResolvingResource.java:173)
    at org.springframework.core.io.Resource$lastModified.call(Unknown Source)
    at org.grails.plugin.resource.ResourceMeta.isDirty(ResourceMeta.groovy:147)
    at sun.reflect.GeneratedMethodAccessor679.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.OriginalClassInvoker.invoke(OriginalClassInvoker.java:47)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1272)...

For Grails resources plugin, these images are static. When I used grails.resources.adhoc.excludes option, my images aren't rendered at all on the website.

Is there any good way to upload and delete dynamically images (files) from grails app?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user2040547
  • 141
  • 1
  • 6
  • I solved this problems, solution is very simply. I am accessing images direcly(myapp.com/imagesFolder/image.jpg), not by resources plugin(not by grails tag ). – user2040547 May 12 '13 at 12:14

1 Answers1

1

The OP wrote:

I solved this problem, solution is very simple: I am accessing images directly (myapp.com/imagesFolder/image.jpg), not by resources plugin (not by grails tag <g:img> ).

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • ([Question solved in the comments and converted to a community wiki](http://meta.stackoverflow.com/questions/251597/question-with-no-answers-but-issue-solved-in-the-comments?rq=1).) – Brian Tompsett - 汤莱恩 Jul 04 '15 at 20:00