confluence attachments don't refresh
Just remember that if you have a confluence page with an attachment with a particular name, and you remove that attachment and add a different one with the same name, when you look at the page, your attachment doesn't update (confluence Version: 2.1.5a Build:#411 Mar 16, 2006).
This is a feature (bug?) to do versioning (i think) in confluence. Don't remove the attachment before re-adding. This should work, although I haven't tried it. I went long way round with guids.