Programmatically Submitting Files to the SharePoint Content Organizer

You may also like...

2 Responses

  1. bruce says:

    awesome post, helped me customize my code to upload a file using a usercontrol and get it into the drop off library for routing. p.s the way im doing this is uploading to the document library direct(no routing), getting the SPFile, then injecting your code which submits it to the drop off library where it gets sent to the correct library. couldnt seem to figure out a way to have a file uploaded from a usercontrol go direct to the drop off library using your code as it has to be an SPFile..i couldnt cast the FileUpload.PostedFile to an SPFile obviously. anyways, im just wondering thats all…its working so maybe if its not broken, dont fix it? 🙂

    • Charles Chen says:

      Bruce,

      I haven’t tried it without creating an SPFile first. Seems that it needs one since one of the parameters is the current URL of the file (it puzzles me as well why this is necessary given that it doesn’t seem to do anything with it).

      One note is that this code seems to cough up on certain types of fields like term store fields.

      Gonna work on that and figure out what the deal is.