Clipping mask retained in jpg file
I have a JPG which appears to of retained a clipping mask:
When this file is opened in photoshop / fireworks and then the "Paths" tab is visited, you can see the saved clipping path on the jpg. However I tried to replicate this in photoshop and couldn't replicate with a new file. How was this done? I assume it is via some form of metadata?
It seems that the clipping path could be removed when uploaded via a web based image uploader, in this case a flash based uploader.
What you're observing is not a clipping mask, per se. Jpeg has no transparency and no concept of clipping or masking. Jpeg does have several metadata sections, and many programs will happily store extra information in there.
Photoshop stores paths, as you've noticed, and guides. To replicate this, create a new file and add some paths and guides. Then "Save As" (not "Save for Web") to create a new JPG. Re-open this file, and you'll see that it saved the guides and paths.
Keep in mind that many programs, uploaders, etc. will not preserve metadata so this can't be depended on for transferring important data.
Just to add to the details you need to name the path, if you leave it as 'workpath' then it will not save the path with the jpg. (i'm using cs6). Just by clicking the name it changes it to 'path 1' which is fine.