I have two document libraries: bucket and Documents. The user uploads the file to the bucket and when all the field are filled, an event receiver checks if the filename already exists (and renames it) and copies the file to Documents.

At the bucket list, I want to inform the user that the filename already exists. I can't find (in Web Api results) a field with the filename.

Are there any other solutions?Even startswith will be fine.Thank you.

2 Answers 2


Use FileLeafRef field to query document names. See this example: http://platinumdogs.me/2009/07/21/querying-document-libraries-or-pulling-teeth-with-caml/


Option 1: You can directly add javascript to the item updating event using ClientScript.RegisterStartupScript to notify the file change.



Option 2: Disable File overwrite option 1. Please take a look at this Stack question. It points to a tutorial blog on how to do this.

In SPD open default.master, then add the script:

    var form = $('form');
    if ( form.attr('action').indexOf('YOUR 36 character List ID - Without Braces') > -1 )
        var checkbox = $('#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_OverwriteSingle');
        var multiple = $('#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_UploadMultipleLink');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.