This project is read-only.

Getting tmp files only on transfer complete

Jul 26, 2012 at 7:19 AM


I am trying to use SharpBITS to transfer files over https, If I use the SharpBits application itself it works good, however I am writing a code that creates a new job and adds two files, then I begin the transfer by calling Resume, I get an event that the job transferred, however when I look at the local directory, I see only tmp files.

Did anyone encounter this issue / know what to do?



Jul 26, 2012 at 9:25 AM

once the item is transferred, you need to call Complete on that item so BITS will finalize the job, i.e. renaming the tmp file into the correct filename and remove the job from the queue. The SharpBITS app does that for you in background, if you code something yourself using the library you have to remember calling Complete.

hope this help

Aug 2, 2012 at 6:43 AM

Thank you very much, it worked.

I have another question, is there a way I can set a file to be optional? I am downloading a list of files based on their file name, from a location I cannot browse, now there is a file that doesn't have to exist, and I get a JobError notification on it and it stops the entire job, is there a way I can tell it to continue the job without that file, or set it to optional from the get go? The current solution I found is just to create a whole new job for it.


Aug 3, 2012 at 7:21 PM

in that case would be best to create a separate job for each file, so if some are failing you can still continue with the other jobs.

Else you may mark an existing job complete even if it's not downloaded completely e.g. in case of job errors so you'll be able to access the files which were already transfered succesfully, however that does not help for files which are not yet transferred.

Aug 5, 2012 at 12:42 PM

Thank you.