ASP NET Documentum Create operation failed for object

Problem

I'm getting the error message listed below while uploading document into Documentum repository through the ASP.NET application. After a while, I noticed that it happen only when I try to upload file with .txt extension. Then I spotted this line of code

 FileContent(FileContentPath, FileExtension)


The FileExtension hold the value txt which is not a correct format for Documentum. The correct format should be crtext and use binary for unknown extension. So, the next time you run into this error, check the file format.


 Server Error in '/MyWebSite' Application. 
"Create" operation failed for object: [test] [id =null]
PROPERTIES [object_name=test|title=MyImage|a_content_type=txt].

Description: An unhandled exception occurred during the execution of the
current web request.

Please review the stack trace for more information about the error and
where it originated in the code.