G
Guest
We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.
In the old application, we had a file attachment component. Purpose of this
component was to attach a file to a ticket and store the file in the
database (Sybase).
I don't have access to the old application but have the following
information about
how this component worked:
1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved and
inserted into the OLE Container. Then activate() method was used to launch
the application associated to the attached file.
Problem we have is that when the file was saved to the database, Application
did not store the file name. So what we have is only the binary data in the
database.
We have no way of knowing what type of file it is (whether MSWord, MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.
As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.
What I like to know from you is
1. Is there any way or API, which can help me identify from the binary data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.
We are trying to replace that application with .net 2005, C# Language.
In the old application, we had a file attachment component. Purpose of this
component was to attach a file to a ticket and store the file in the
database (Sybase).
I don't have access to the old application but have the following
information about
how this component worked:
1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved and
inserted into the OLE Container. Then activate() method was used to launch
the application associated to the attached file.
Problem we have is that when the file was saved to the database, Application
did not store the file name. So what we have is only the binary data in the
database.
We have no way of knowing what type of file it is (whether MSWord, MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.
As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.
What I like to know from you is
1. Is there any way or API, which can help me identify from the binary data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.