Jump to content

upload image form


Sarah_au

Recommended Posts

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?

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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");]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.