How can we identify if the file is a storage file or not. Both are of same .doc format.
I have a code to find if file is a storage file or not with the help of ole32.dll.
Below is my code.
[DllImport("ole32.dll", CharSet = CharSet.Unicode)]
public static extern int StgIsStorageFile(string pwcsName);
Calling in below manner:
StgIsStorageFile(this.filePath) != 0)
return false;
Now there is a file uploaded by the client in .doc format.
For some reason, this file always returns 1 means it is not a StorageFile.
When I manually created .doc file with the same content it works fine.