Re-attaching files from commonstore

I need to get back (“re-attach”) attachments archived via commonstore to TSM. This needs to be done using a notes agent. I tried to use getdocumentbyurl, but e.g. Apache server in my test env (not connected to CommonStore) returns html page with a link to the .tif file I try to retrieve. I cannot get hold to the data itself.

Does anybody have a way/code how to get the .tif file back to notes using lotusscript/JAVA agent?

Subject: Got it

Set doc = db.GetDocumentByURL(url). Url is the link from the notes document, from where the attachment has been archived by CSLD.

The doc created contains the original attachment attached to the doc created, but without name.

How can I get hold of the attachment file? E.g. doc.GetAttachment requires the name of the attachment file.