Monday, 3 September 2012

How to bypass Edit Properties Page while uploading documents in a document library

Skip edititem.aspx while uploading documents to document library in sharepoint
or
How to bypass Edit Properties Page while uploading documents in a document library

 

Simply add this to your edititem.aspx below the placeholdermain



<script type="text/javascript">
    _spBodyOnLoadFunctionNames.push("Redirect");
    function Redirect()
    {
       var mode = getURLParam('Mode');    
      /*  var sourceURL = getURLParam('Source');      
       var  properSourceURL = replaceCharacters(sourceURL);    */
       if (mode == "Upload")
     window.frameElement.commonModalDialogClose(1, 'saved');
              /* window.location = properSourceURL;*/
             
}
 
    function getURLParam(name)
{
 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
 var regexS = "[\\?&]"+name+"=([^&#]*)";
 var regex = new RegExp( regexS );
 var results = regex.exec( window.location.href );
 if( results == null )
   return "";
 else
   return results[1];
}

function replaceCharacters(str)
{
  str = str.replace(/%20/g, " ");
  str = str.replace(/%2F/g, "/");
  str = str.replace(/%3A/g, ":");
  str = str.replace(/%2E/g, ".");
  return str;
}

</script>

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. how about avoid edit properties dialog window and show the edit page instead?

    ReplyDelete
  3. how about avoid edit properties dialog window and show the edit page instead?

    ReplyDelete
  4. how about avoid edit properties dialog window and show the edit page instead?

    ReplyDelete