|
-
March 8th, 2005, 03:51 AM
#1
Write file and read file on the remote computer
I am bulding a application that download and upload data from any server to local computer and from local computer to the server. but I have a problem, I have not any resolve. During I am uploading and the connection is disconnected (an example) At the moment the file is not finished (50%), I wants to continue at the later time uploading(from 50%) (I don't wants to the uploading begin at 0%). Any body can help me, please.
thanks very much.
-
March 8th, 2005, 04:32 AM
#2
Re: Write file and read file on the remote computer
You probably have to implement some sort of resume message that tells the client/server where it should start reading the file.
The side that should be receiving the file
Code:
FILE *f = fopen("file_to_recv", "rw");
long off;
fseek(f, 0, SEEK_END);
off = ftell(f);
/* tell offset to other side */
The side that should send the file
Code:
FILE *f = fopen("file_to_send", "r");
long off; /* = get offset from other side */
fseek(f, off, SEEK_SET);
/* start reading from file and send it */
If you try and take a cat apart to see how it works,
the first thing you'll have on your hands is a nonworking cat
-
March 9th, 2005, 08:37 PM
#3
Re: Write file and read file on the remote computer
Thank you Svenhag for your idea, but I have difficulty with reading and writing file on the Server. I do not know what class I can use.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|