Windows Develop Bookmark and Share   
 index > Windows Forms General > How To ? file into code for Xfer over web!
 

How To ? file into code for Xfer over web!

Ok heres what I have.

1] SmartClient that will ask user to pick a file from the PC. Lets say a .wmv.
       Could be anytype of file other then a image file.
2] On a click of a button the app links to a webservice and xfers the file to the webserver.

So No problem getting the user to pick a file on the their PC.
My problem is how do I load this file into a object in code, vb.net, that would allow me to xfer that object to the webservice and have the webservice save it to the folder on the webserver.

hope thats clear. I have done this every thing for image files. But there I had the nice image object to play with. In this case the file could be a .wmv / .mpg / .wma / .mp3

Any ideas, pointers to help me along here.
Thanks
Deasun
Deasun  Thursday, July 14, 2005 6:37 PM
What kind of data does the web service accept? I would guess it's a byte array, right? Then you can use the System.IO.FileStream and StreamReader classes to open the selected file and read the bytes from it.
Daniel Rieck  Thursday, July 14, 2005 7:18 PM
What kind of data does the web service accept? I would guess it's a byte array, right? Then you can use the System.IO.FileStream and StreamReader classes to open the selected file and read the bytes from it.
Daniel Rieck  Thursday, July 14, 2005 7:18 PM

You can use google to search for other answers

Custom Search

More Threads

• Application refused to exit
• Disappearing data rows
• HELP: converting between C# and access datatypes
• There is a pure win32 control, I don't know how it's created, But I just wanna show it in a form control
• MDI Help
• Print Page confusion
• Problem detecting changes on parent-child bindingsource
• how to Draw arc,ellipse without giving default values?
• What's a good way to choose two dates for a search filter ?
• calling graphics object from textbox?