aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes uploaded image file doesnt reflect in the page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "uploaded image file doesnt reflect in the page" Watch "uploaded image file doesnt reflect in the page" New topic
Author

uploaded image file doesnt reflect in the page

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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?

A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If it only works after refreshing your IDE then it's because your IDE isn't deploying the new image.
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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

Joined: Apr 16, 2005
Posts: 689
please somebody help me!!!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Apr 16, 2005
Posts: 689
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 10, 2002
Posts: 61232
    
  66

As this is an eclipse issue versus a real JSP issue, it's been moved to the IDEs forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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

Joined: Sep 29, 2008
Posts: 12617

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: uploaded image file doesnt reflect in the page