Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2006, 02:00 AM
Registered User
 
Join Date: Dec 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old January 8th, 2007, 02:34 PM
Registered User
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hadware Send a message via Yahoo to Hadware
Default

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.

--Eric
 
Old March 27th, 2007, 07:00 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ajishkm
Default

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..

Ajish

 
Old March 27th, 2007, 07:06 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What type of application?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 28th, 2007, 04:43 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ajishkm
Default

hi..

  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..

thanks,

Ajish






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Html Stream into PDF format anwar_suk Classic ASP Basics 1 May 25th, 2006 07:57 AM
xml binary file to ADO stream clk1022 XML 1 March 17th, 2006 03:33 PM
XML binary file to ADO stream object clk1022 ASP.NET 2.0 Professional 0 March 16th, 2006 10:31 PM
XML binary file to ADO Stream object clk1022 VB.NET 1 March 16th, 2006 10:23 PM
plus '+' replace by space " " in binary stream rupakb XML 0 October 26th, 2004 11:35 AM





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