Reputation: 6286
Please refer to question: Resume in upload file control
Now to find a solution for the above question, I want to work on it and develop a user control which can resume a HTTP File Upload process.
For this, I'm going to create a temporary file on server until the upload is complete. Once the uploading is done completely then will just save it to the desired location.
The procedure I have thought of is:
pause
button, the writing of file is stopped and the temporary file is not deleted. resume
or to overwrite
. (Not sure how to check if it's the same file. Also, how to step sending the chunks from client to server.)resume
will start from where it is required to be uploaded and will append that to the file on the server. (Again not sure how to do this.)Questions:
Any help appreciated...
Upvotes: 2
Views: 3115
Reputation: 1507
What you are trying is not easy, but it is doable. Follow these guidelines:
Write 2 functions on the client side using ajax:
getUploadedPortionFromServer(filename)
- This will ask the server if the file exists, and it should get an xml response from the server with the following info:boolean(exist/not exist)
, size(bytes)
, md5(string)
uploadFromBytes(x)
- Will depend on the 1st function.On the server you have to write matching functions, which will check the needed stuff, and send the response via XML to the client.
Upvotes: 2