Replace an asset's file
If you need to replace the file of an existing attachment without changing the URL, follow these steps:
Copy the new file from your computer to the server:
scp filename.zip asset-master-1.production:/tmp/filename.zip
Find the asset: “
asset = Asset.find("asset-id-from-url")# e.g.
or for a Whitehall asset:
asset = WhitehallAsset.find_by(legacy_url_path: ’/government/uploads/system/uploads/attachment_data/file/id/path.extension’)
Check the asset is what you think it is.
Replace the file: