3

In our SharePoint 2013 application we have developed a feature to limit max upload file to 250 MB.

Now this feature works in some Internet Explorer versions and doesn't work in others, as a result we have decided to scrap this feature and instead put a small text on upload.aspx informing the users about the file size limit.

Request your suggestions on this.

2 Answers 2

3

Got following solution from MSDN :

<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript"> 
$(document).ready(function() {
if (window.location.href.toLowerCase().indexOf('/_layouts/15/upload.aspx') > 0) 
 {
  $('input:checkbox').closest("td").append("The files uploaded no more than 250MB");
 }
});  
</script>

The above code should be integrated in the "upload.aspx" MasterPage.

3
  • Please do not post link only answers! Instead include the details in your answer, to make it more useful for future readers Aug 6, 2014 at 6:44
  • @RobertLindgren have edited the post as per your suggestion.
    – Vishawjeet
    Aug 6, 2014 at 7:00
  • Great! :) But you should leave the link in your post as well as a source Aug 6, 2014 at 7:02
-1

There is a workaround to add text to the Upload.aspx. Add following javascript code to your masterpage:

jQuery(document).ready(function() {
    if (window.location.href.toLowerCase().indexOf('/_layouts/15/upload.aspx') > 0) {
        jQuery('input:checkbox').closest("td").append("
Message for size limit"); } });

Above code will display message on all the upload pages. To show this message on particular document library upload page:

if (window.location.href.toLowerCase().indexOf('DOCUMENT_LIBRARY_URL/_layouts/15/upload.aspx') > 0)
3
  • Thanks Hemant . I added following Java Script in Seattle and Oslo Master pages but I don't see any change in the upload.aspx page after - <SharePoint:CustomJSUrl runat="server" /> Code - <script type="text/javascript" src="/_layouts/custom.js"> jQuery(document).ready(function() { if (window.location.href.toLowerCase().indexOf('/_layouts/15/upload.aspx') > 0) { jQuery('input:checkbox').closest("td").append("Message for size limit"); } }); </script>
    – Vishawjeet
    Jul 25, 2014 at 4:22
  • Make sure you have jquery reference added to your masterpage before the script block. Also add above code in regular script block under head tag. Jul 25, 2014 at 5:07
  • Thanks Hemant. I got a solution on MSDN. Its similar to your suggestion.
    – Vishawjeet
    Aug 6, 2014 at 5:36

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.