Disable redirect to editform.aspx after upload to document set
I've noticed that for my document set type, whenever I add a new document to the document set, the edit dialog pops up. Is there any way to disable the edit dialog from opening automatically?
August 28th, 2013 9:22pm

Hi,

I suggest to use javascript code to block the edit modal dialog when uploading file.

We can use SharePoint Designer 2013 to open the EditForm.aspx of the specific document library, add the code snippet below under the tag <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">:

<script type="text/javascript">

 function GetQueryStringArgs(){

     //fetch querystring and remove first ?

     var qs=(location.search.length>0?location .search.substring(1):"");

     //create an object for saving data

     var args={};

     var items=qs.split("&");

     var item=null,

         name=null,

         value=null;

     //add to args object one by one

     for(var i=0;i<items.length;i++){

         item=items[i].split("=");

         name=decodeURIComponent (item [0]);

         value =decodeURIComponent (item[1]);

         args[name]=value ;

         }

         return args ;

     }

 var args=GetQueryStringArgs();

 var urlReferrer=document .referrer .toString ();

 if(urlReferrer .indexOf ("Upload")!=-1){

     window.frameElement.commitPopup();

 }</script>

Then save the EditForm.aspx and refresh the site page in browser to check the result.

best regards

Free Windows Admin Tool Kit Click here and download it now
August 29th, 2013 12:25pm

Hi,

I suggest to use javascript code to block the edit modal dialog when uploading file.

We can use SharePoint Designer 2013 to open the EditForm.aspx of the specific document library, add the code snippet below under the tag <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">:

<script type="text/javascript">

 function GetQueryStringArgs(){

     //fetch querystring and remove first ?

     var qs=(location.search.length>0?location .search.substring(1):"");

     //create an object for saving data

     var args={};

     var items=qs.split("&");

     var item=null,

         name=null,

         value=null;

     //add to args object one by one

     for(var i=0;i<items.length;i++){

         item=items[i].split("=");

         name=decodeURIComponent (item [0]);

         value =decodeURIComponent (item[1]);

         args[name]=value ;

         }

         return args ;

     }

 var args=GetQueryStringArgs();

 var urlReferrer=document .referrer .toString ();

 if(urlReferrer .indexOf ("Upload")!=-1){

     window.frameElement.commitPopup();

 }</script>

Then save the EditForm.aspx and refresh the site page in browser to check the result.

best regards

August 29th, 2013 12:25pm

Great solution! This solution works for me with one caveat: The user still needs EDIT permissions for this to work. In other words, if you are using a drop folder (very common in schools for assignments) with only add permissions, the user gets the follow up edit window as a page they do not have access to. In your solution the page doesn't display but only if you have the edit permissions. Is there a way this could work if a user only has the read and add permissions? SharePoint still checks to see if the user had access so I'm not sure have to get around that but not for lack of trying! Any help would be great.
  • Proposed as answer by 2mp Tuesday, September 24, 2013 11:08 PM
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2013 9:46pm

Great solution! This solution works for me with one caveat: The user still needs EDIT permissions for this to work. In other words, if you are using a drop folder (very common in schools for assignments) with only add permissions, the user gets the follow up edit window as a page they do not have access to. In your solution the page doesn't display but only if you have the edit permissions. Is there a way this could work if a user only has the read and add permissions? SharePoint still checks to see if the user had access so I'm not sure have to get around that but not for lack of trying! Any help would be great.
  • Proposed as answer by 2mp Tuesday, September 24, 2013 11:08 PM
September 17th, 2013 9:46pm

That's for the solution, worked for me. It is worth noting that the code you supplied doesn't actually use the function GetQueryStringArgs. So all you need is this chunck

 var urlReferrer=document.referrer.toString();

 if(urlReferrer.indexOf("Upload")!=-1)
{
     window.frameElement.commitPopup();
 }

Free Windows Admin Tool Kit Click here and download it now
May 14th, 2015 3:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics