Sarah_au Posted July 18, 2011 Share Posted July 18, 2011 hi I am using joomla 1.5. I have designed a form which is accessed by a link using the wrapper. The form gets details from a non joomla table and displays them on the page. One of the items is a user image. The user can then change the image, click the upload button and the image is uploaded. The name of the image is the same as the username.jpg and any existing image is overwritten. However when the user returns to the upload page the displayed image is the same as before the upload. No matter how many times the page or the frame is refreshed the image will not change. If one right clicks on the image and views it the image that is viewed is the new image. Clicking the back button takes the user back to the upload image page and now the new image is displayed. How on earth can I make the new image display properly? Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/ Share on other sites More sharing options...
AyKay47 Posted July 18, 2011 Share Posted July 18, 2011 can you post the code that is causing these errors to this thread please. Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244195 Share on other sites More sharing options...
Sarah_au Posted July 18, 2011 Author Share Posted July 18, 2011 well which part? The form gets the details from the database and displays the current image. name = user1 image=user1.jpg No problem there. one selects a new image using the input box <input type="file" size="32" name="my_field" value="" /> click the submit button to go to the page with the upload script and the image gets uploaded. The new image is displayed on that page. Return to the form and the old image is displayed even though the image on the server is a new image. The reason I dont post the whole code is that the second page, the processing page contains the upload script which is long and detailed. there is also a non joomla login auth script included to make sure the user is logged in Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244204 Share on other sites More sharing options...
AyKay47 Posted July 18, 2011 Share Posted July 18, 2011 have you confirmed that the new image is being uploaded and the old image is being removed? If this is the case, this is most likely a cache error or a dynamic image path error. Does the image show if you press ctrl + f5 ? If this does not work, please post the code around where the old image is still being displayed. Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244214 Share on other sites More sharing options...
Sarah_au Posted July 18, 2011 Author Share Posted July 18, 2011 I tried it outside of joomla using firefox and sometimes it would change and other times it wouldnt and sometimes it displayed the old image and then changed to the new image When I tried it with IE there was no problem it showed the new image with no probs. Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244226 Share on other sites More sharing options...
AyKay47 Posted July 18, 2011 Share Posted July 18, 2011 try adding these headers at the top of your page, these should prevent the page from caching your image, header("Expires: Mon, 17 Jul 2000 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache");] Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244228 Share on other sites More sharing options...
Sarah_au Posted July 18, 2011 Author Share Posted July 18, 2011 No it does no good. It is something in joomla because it works fine outside of joomla. I might give up on it and just get a popup window to make the changes. Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244244 Share on other sites More sharing options...
AyKay47 Posted July 18, 2011 Share Posted July 18, 2011 has to do with joomla caching, this here might assist you Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244247 Share on other sites More sharing options...
Sarah_au Posted July 18, 2011 Author Share Posted July 18, 2011 No didnt do a thing. Funny thing is that in IE there is no problem even in joomla. Thanks for the help its bedtime. Quote Link to comment https://forums.phpfreaks.com/topic/242265-upload-image-form/#findComment-1244253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.