Restricting file upload size to 5 MB - InfoPath Dev
in

InfoPath Dev

Restricting file upload size to 5 MB

Last post 05-23-2013 10:32 PM by PRKJ211. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-22-2013 11:15 PM

    Restricting file upload size to 5 MB

    Hi,

     I have an infopath 2010 form published to a document library. Its not browser enabled. I have a requirement to restrict the file upload size to 5 MB.

    Can anyone please confirm if there is any other out of the box option to do it?

     Thanks :)

    Regards,
    PRKJ
  • 05-23-2013 09:32 AM In reply to

    Re: Restricting file upload size to 5 MB

     Is this restrict the size of the InfoPath form or attachments within a form?

     

    If it is an attachment you could do the following:

    Add validation to the field:

    1. Open the Data Source pane
    2. Double-click on field1 to bring up its properties
    3. In Validation, add a new condition
    4. Select Expression, type this expression in: string-length(.) > 136533
    5. Enter the text to be displayed when the error condition occurs

    Now when you edit the form, if the image is too big, you will get an error validation and the user will be warned on save.

    I haven’t tested this and it will need checking with multiple attachments. The above figure of 136533 is for a 100KB limit. To calculate the relevant figure:

    ExpressionLimit = KB * 1024 / 0.75

    In SP you'll have to play around with Maximum Upload Size in Central Admin. This setting will more than likely affect more than just your one library.

    If it's via email, can you not use your email client?

  • 05-23-2013 10:32 PM In reply to

    Re: Restricting file upload size to 5 MB

    Thanks for the information!

    It was very helpful. I tried this validation rule and it worked - string-length(.) > 5242880 (5MB).

    I wanted this validation for attachments within the infopath form.

    Regards,
    PRKJ
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.