江湖路
专注AJAX和Moss

使用SP内置的上传控件,代码如下:

    <script type="text/javascript">
        function DocumentUpload() {
            document.getElementById("idUploadCtl").MultipleUpload();
        }
    </script> 
<object id="idUploadCtl" name="idUploadCtl" classid="CLSID:07B06095-5687-4d13-9E32-12B4259C9813"
        width="638" height="261">
        <param name="AutoSize" value="False">
        <param name="AutoSizeMode" value="GrowOnly">
        <param name="AutoValidate" value="EnablePreventFocusChange">
        <param name="BorderStyle" value="None">
        <param name="CurrentAutoScaleDimensions" value="8, 15">
        <param name="AutoScroll" value="False">
        <param name="AutoScrollMargin" value="0, 0">
        <param name="AutoScrollMinSize" value="0, 0">
        <param name="AccessibleDescription" value="">
        <param name="AccessibleName" value="">
        <param name="AccessibleRole" value="Default">
        <param name="AllowDrop" value="True">
        <param name="Anchor" value="Top, Left">
        <param name="AutoScrollOffset" value="0, 0">
        <param name="BackColor" value="Window">
        <param name="BackgroundImage" value="">
        <param name="BackgroundImageLayout" value="Tile">
        <param name="CausesValidation" value="True">
        <param name="Cursor" value="Arrow">
        <param name="Dock" value="None">
        <param name="Enabled" value="True">
        <param name="Font" value="宋体, 15world">
        <param name="ForeColor" value="76, 76, 76">
        <param name="Location" value="12, 199">
        <param name="Margin" value="4, 3, 4, 3">
        <param name="MaximumSize" value="0, 0">
        <param name="MinimumSize" value="0, 0">
        <param name="Name" value="UploadCtl">
        <param name="RightToLeft" value="No">
        <param name="Size" value="797, 326">
        <param name="TabIndex" value="0">
        <param name="TabStop" value="True">
        <param name="Tag" value="">
        <param name="UseWaitCursor" value="False">
        <param name="Visible" value="True">
        <param name="PreferredSize" value="797, 326">
        <param name="Padding" value="0, 0, 0, 0">
        <param name="ImeMode" value="NoControl">
    </object>
    <input type="hidden" name="Confirmation-URL" value="" />
    <input type="hidden" id="PostUrl" name="PostUrl" value="" />
    <input type="hidden" id="destination" name="destination" value="/Shared Documents" />
    <input type="hidden" id="putopts" name="putopts" value="true" />
    <input type="hidden" name="VTI-GROUP" value="0" />
    <input type="hidden" name="Cmd" value="Save" />
    <asp:Button ID="Button1" runat="server" Text="上传" OnClientClick="DocumentUpload(); return false;" />

其中destination为上传路径。

posted on 2013-01-06 13:40  wengnet  阅读(605)  评论(0编辑  收藏  举报