1.先导包,Brettle.Web.NeatUpload.dll导进web层中,再添加到vs控件中。
2.把NeatUpload文件夹放到根目录下。
3.直接拉要用到的控件到页面上,在使用
<Upload:ProgressBar ID="pbProgressBar" runat='server' Height="" Width="" Inline="true">
</Upload:ProgressBar>
时,最好加上高和宽,要不会变态的。
4.配置web.config文件
(1)在configSections节点里添加:
<sectionGroup name="system.web"> <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" /> </sectionGroup>
(2)在system.web节点里添加:
<!--useHttpModule="true" 设为true时才能看到上传状态,默认是False-->
<neatUpload useHttpModule="true" maxNormalRequestLength="" maxRequestLength="" defaultProvider="FilesystemUploadStorageProvider"> <providers> <add name="FilesystemUploadStorageProvider" type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider, Brettle.Web.NeatUpload" /> </providers> </neatUpload>
(3)在system.web节点里找httpModules,如果没有直接添加:
<httpModules> <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" /> </httpModules>
<!--useHttpModule="true" 要設true才能看到上傳狀態bar,預設是False-->
然后就可以用了。