[preivew-file] Check if can preview file before further operation
Merge pull request #318 from haiwen/4.0-fix-preview-file

[preivew-file] Check if can preview file before further operation