File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploaded image file doesnt reflect in the page

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am facing some typical problem with image uploading, I ma using commons file upload API for uploading image file.

When image is uploaded to /[mywebapp]/images/ folder it successfully uploads there, I have cross verified it by exploring to that directory manually.
The problem here is I dont see the updated uploaded image file in my web page even I refresh my browser.

But when I refresh the web application project folder in my eclipse IDE then if refresh browser window it reflects update image.


why it is happening like this? any solution for this?

am I doing any thing wrong while displaying the image file in the browser?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it only works after refreshing your IDE then it's because your IDE isn't deploying the new image.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Thanks for your response.

earlier I tried with firefox and now I tried with IE and come to know that after deleting offline content I could able to see the uploaded image file.


don't know what is happening internally.

Thanks,
Sai

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please somebody help me!!!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How? You haven't given any additional information, described your deployment environment, explained what you meant by "deleting offline content", told us if you're properly setting "no cache" headers when you stream the image back (or are you directly accessing the image? Which would lead to issues when your app is redeployed since the image directory might be deleted.)
 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

I directory is not being deleted internally because I can check the latest file uploaded in that directory, confirmed it manually by using windows explorer.

My deployment is using tomcat inbuilt plugin in Eclipse IDE and I just start the server in my IDE and it runs internally. everyhitng is fine and comign to uploads is also ok but when I access that image url from my browser it shows older image file not the uploaded image file.

Every time I upload the image file it will replace the existing file in the same location with the same name so it doesn't show the latest uploaded file but it shows older image file with the same url.

However I can confirm that new file is uploaded properly in that location by exploring to that location manually.

When I refresh web content folder in my IDE then it reflects in the browser as well..


I am not aware of cache..


any more questions?? please let me know.

Thanks,
Sai
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I kind of already told you what the issue is; Eclipse will not redeploy the file until you do an F5, "Refresh Workspace".
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this is an eclipse issue versus a real JSP issue, it's been moved to the IDEs forum.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:I kind of already told you what the issue is; Eclipse will not redeploy the file until you do an F5, "Refresh Workspace".



Thanks David.

But how to work in the development environment while working on images?

any better approach?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't serve images from within the web application working directory? Other than that, I can't think of anything. Is hitting F5 that difficult?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic