How can I create a view that shows image file fields which do not have any data? I'm using Drupal 7 and I have a content type, Picture, which includes an image field.  Users use this to add image to the site.

Sometimes, however, there is no data on the server.  For example, if I copy the database from my production to my testing server, the image files will be registered in the db but they don't actually exist on the testing server, so the pictures cannot be displayed.

I would like to create a view that shows these images-- the data is in the DB, but the file does not actually exist. 

I created a view for my content type Picture and added the following Filter Criteria


Image: fid- empty
OR File size- empty (Through File Usage: File relationship) 


However, this does not show pics that exist in the DB but not in the filesystem.

Is there a way to do this in views, or is there no way to test if the file actually exists?
One way of going about this is using Views PHP. Add your file path as a field and exclude it from display. Add a Global: PHP filter with return file_exists($row-&gt;uri); as your filter code. This should return TRUE for files that do exist, and will remove those from the results, showing only files in your database that do not exist. Your current filter criteria are only checking the file_managed table in the database and are not going to be aware if the file exists.