Silverlight Multi File Uploader(多文件上传)

Document:

http://www.michielpost.nl/Silverlight/MultiFileUploader/

 

Configuration:

  • MaxFileSizeKB: File size in      KBs.
  • MaxUploads: Maximum number of simultaneous uploads
  • FileFilter: File filter, for      example ony jpeg use: FileFilter=Jpeg (*.jpg) |*.jpg ,

to have a range of file types for the upload control, configure the filter string like this: JPEG|*.jpg|PNG|*.png|TIFF|*.tiff|GIF|*.gif

  • CustomParam: Your custom      parameter, anything here will be available in the WCF webservice
  • DefaultColor: The default      color for the control, for example: LightBlue
  • ChunkSize: Size of each      uploaded chunk in bytes (minimum is 4096, default is 4194304) (only for      the HttpUploader)
  • UploadHandlerName: Custom      specified name of the HttpUploadHandler, for example this can be      "PHPUpload.php" to use the PHP upload handler.

Parameters:

<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/mpost.SilverlightMultiFileUpload.xap" MinimumVersion="2.0.30523" Width="415" Height="280" InitParameters ="MaxFileSizeKB=1000,MaxUploads=2,FileFilter=,CustomParam=1,DefaultColor=LightBlue" />

 

 

 

Any question please find the comment on the bottom of the document page first.

 

Use Silverlight Multi File Uploader,

  1. Add ClientBin      folder(silverlight 资源文件) ,HttpUploadHandler.ashx(后台处理页面),

  2。  Add codes below in Page

<div id="silverlightControlHost">

    <object id="MultiFileUploader" data="data:application/x-silverlight-2," type="application/x-silverlight-2"

        width="450" height="200">

        <param name="source" value="ClientBin/mpost.SilverlightMultiFileUpload.xap" />

        <param name="onerror" value="onSilverlightError" />

        <param name="initParams" value="MaxFileSizeKB=,MaxUploads=2,FileFilter=txt|*.txt|dll|*.dll|config|*.config|xml|*.xml,ChunkSize=4194304,CustomParams=yourparameters,DefaultColor=White" />

        <param name="background" value="white" />

        <param name="onload" value="pluginLoaded" />

        <param name="minRuntimeVersion" value="4.0.50401.0" />

        <param name="autoUpgrade" value="true" />

        <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">

            <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"

                style="border-style: none" />

        </a>

    </object>

    <iframe style='visibility: hidden; height: 0; width: 0; border: 0px'></iframe>

</div>

 

FileFilter=All Images|*.jpg;*.png;*.gif|All Documents|*.doc;*.txt

posted @ 2013-01-15 10:33  不要说话,用心听  阅读(363)  评论(0)    收藏  举报