Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 28th, 2005, 6:44 PM   #1
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4 Brent is on a distinguished road
sending .zip files with winsock

could someone show me how to send .zip files over a connection using winsock? thanks for the help.
Brent is offline   Reply With Quote
Old Aug 28th, 2005, 7:04 PM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
the same way you send anything else.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old Aug 28th, 2005, 7:32 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Binary data is just a series of bits, some in one state and some in another. You can't tell what the content is just by looking. The meaning of any data is established by external agreement and convention. A file with the extension, ".exe", is presumed to be a Windows executable file, but I can rename an Excel spreadsheet to that if I like. It probably won't do anything useful. Besides, there are other conventions internal to a file that Windows will examine before attempting to execute it. These conventions are USUALLY sufficient to establish the credentials of a file, but it isn't a done deal. A lot of file types have a "magic number" in the first couple of bytes, but it's certainly not impossible (or even greatly improbable) for the first two bytes of a file of random data to contain that pattern.

All this is the reason that lots of data transfer mechanisms wrap the information inside a protocol (sometimes, layers of protocols). It's just another convention that increases the probability that you interpret the data correctly and, sometimes, without error.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 29th, 2005, 9:37 AM   #4
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4 Brent is on a distinguished road
can i just send the filename over the connection, or do i have to open the file read the data and send that over the connection?
Brent is offline   Reply With Quote
Old Aug 29th, 2005, 9:48 AM   #5
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Quote:
can i just send the filename over the connection, or do i have to open the file read the data and send that over the connection?
Uh, depends entirely on whether the two computers are on the same workgroup. If they are and the file you want to send is available through it, you can just send the filename and modify the filename slightly on the receiving box so it can read the file from that. Or something, I think.
Otherwise, you read the file and send it over. Before you do that, though, send the length of the data in the file over the second computer, so that when you have finished sending the data over the second computer can check to see if it's got the correct amount of data (and so more or less a simple way of checking whether the file was sent correctly).
Cerulean is offline   Reply With Quote
Old Aug 29th, 2005, 10:08 AM   #6
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
http://www.ecst.csuchico.edu/~beej/guide/net/
This is your bible, print it, read it, and sleep with it under your pillow.
-Dizz
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Aug 29th, 2005, 5:55 PM   #7
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4 Brent is on a distinguished road
ok thanks
Brent is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:29 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC