tom.ash at newint
Jul 11, 2011, 7:27 AM
How do I check whether a media file (or story) with a particular URI exists? I ask because I can't republish a particular story on our site, getting the following error:
How to check if a media file with a particular URI exists
Story "May 1980 - Issue 087" saved and checked in to "Publish".
The URI "/issues/1980/05/01/110px_087-mag-cover.jpg" is not unique. Please change the cover date, output channels, category, or file name as necessary to make the URIs unique.
Here's the code in the template for that story which seems to be responsible this, which I'm guessing I need to execute only after checking that media file doesn't exist:
newmedia_title_prefix=>"110px for ",