Archived Forum Post

Index of archived forum posts

Question:

CreatePlan and PutPlan

Nov 08 '12 at 22:19

Are any events fired by the CreatePlan method that could be used to filter the plan created before using it to call PutPlan ?

Say I wanted to generate a plan for a directory but filter out certain files and one or more sub directories, and use the feature of PutPlan to resume where it left off if an upload failed by passing in the processed file list it creates.

I know I could use PutTree to do this with the OnBeginFileUpload event to skip a given file, and manage the successfully uploaded file list myself or use the OnVerifyUploadDirectory called by PutPlan to skip whole sub directories, but it doesn't appear that I can tell PutPlan to skip an individual file(s).


Accepted Answer

Cody, I'll investigate to see what can be done, and if these callbacks can be added for the next version (and provided as a pre-release).


Answer

Cody, yes you're correct about the OnVerifyUploadDir being called twice. Let's say you have a directory tree like this:

subDir1
    file1
    file2
    dirA
        file3
        file4
    dirB
        file5
        file6

The 1st call to OnVerifyUploadDir for "dirA" is to determine the files within "dirA" or sub-directories under "dirA" should be traversed. The 2nd call is to determine if the empty "dirA" directory itself should be created on the server.