p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   How to convert Word files into Binary Stream (http://p2p.wrox.com/showthread.php?t=51369)

kesar December 11th, 2006 02:00 AM

How to convert Word files into Binary Stream
hi all,
i have some word files and i need them to be stored in SQL database in binary format.
also i may need to open same word file from the database itself.

how to do that?

i have the code to convert jpeg (image) files into binary stream, but no idea how to convert and retrieve word files

Hadware January 8th, 2007 02:34 PM

Try using:
                ' Determine File Type
                strFileExtension = Right(txtFileContents.PostedFile.FileName, 4)
                Select Case strFileExtension.ToLower
                    Case ".doc"
                        strFileType = "doc"
                    Case ".ppt"
                        strFileType = "ppt"
                    Case ".htm"
                        strFileType = "htm"
                    Case "html"
                        strFileType = "htm"
                    Case ".xls"
                        strFileType = "xls"
                    Case Else
                        strFileType = "txt"
                End Select

If you can upload images into a database through binary this should help. If you need any more help with uploading and downloading word docs let me know.

hope that helps.


ajishkm March 27th, 2007 07:00 AM

hi kesar..

 i want to convert jpeg file into binary stream and back.. will u please help me to do that.. its very urgent..

 thanks in advance..


dparsons March 27th, 2007 07:06 AM

What type of application?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
================================================== =========
Why can't Programmers, program??
================================================== =========

ajishkm March 28th, 2007 04:43 AM


  i am working on a network monitoring tool in C#. in that there is an option to take the print screen of the client machine and send that jpeg image(screen image) back to the server.

  i am doing this through socket programming. So i need to convert the jpeg file into binary stream to send it through the socket and then need to convert it back into original format for displaying at the server side.
   hope this will help you to understand the kind of application and the solution for it..



All times are GMT -4. The time now is 11:46 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.