zoukankan      html  css  js  c++  java
  • TopXPages Blog Resources FAQ Contact Us About Sample Code

    This is two XPages tips rolled into one prompted by my colleagues Maire Kehoe and Niklas Heidloff.


    So the question was how do I upload files larger than 1mb via XPages and how do I increase the timeout limit to allow for slow network speeds when I'm uploading these big files?

    So the first part, how do I increase the file upload limit? I posted this a while back explaining how this can be done. There's two parts that need to be done to get this to work. First, you set the size you want of the option 'xsp.upload.maximumsize' in the xsp.properties file (at app or server level). The default being 1024Kb, e.g. xsp.upload.maximumsize=1024.

    The second is done on the server document where you got to set a higher level on the HTTP stack. Go to Internet Protocols\Domino Web Engine and set what you need on 'POST Data' in 'Maximise POST data'. The default here is 10Mb.

    So that's your limit done.

    Now to increase timeout so when I'm uploading those large file it doesn't fallover. The timeout default is 20 seconds in this case, but you may get some cases where it will take longer to upload an attachment. The current way to do this is by using XSP.submitLatency

    <xp:scriptBlock id="scriptBlock1">
    <xp:this.value><![CDATA[XSP.addOnLoad(function(){
    // change submitLatency to 2 seconds (defaults to 6 seconds):
    XSP.submitLatency = 5 * 1000; 
    alert(XSP.submitLatency);
    });]]></xp:this.value>
    </xp:scriptBlock>

    In 852* a new option has been added to the xsp.properties which will do the same - xsp.partial.update.timeout

     
    # #######################################
    # PARTIAL UPDATE TIMEOUT
    # #######################################
    # There allows a use to configure the partial update timeout in Designer# The default is 20 seconds #xsp.partial.update.timeout=20


    Or you can set the option for just this XPage:

    <?xml version="1.0" encoding="UTF-8"?>
    <xp:view xmlns:xp="http://www.ibm.com/xsp/core"> <xp:this.properties> <xp:parameter name="xsp.partial.update.timeout" value="3"></xp:parameter> </xp:this.properties> </xp:view>

    The option is in seconds (the submitLatency is in milliseconds).

     Hope this helps.

  • 相关阅读:
    js正则表达式验证【引用网址】
    Chart控件的使用实例
    C#进阶系列——WebApi 接口返回值不困惑:返回值类型详解
    C#进阶系列——WebApi 接口参数不再困惑:传参详解
    C#进阶系列——WebApi 路由机制剖析:你准备好了吗?
    【UiPath 中文教程】02
    八幅漫画理解使用JSON Web Token设计单点登录系统
    JSON Web Token(缩写 JWT) 目前最流行的跨域认证解决方案
    webservice 教程
    IBM MQ 使用指南
  • 原文地址:https://www.cnblogs.com/hannover/p/1971275.html
Copyright © 2011-2022 走看看