Salvete! 虽然寻找一个优质,免费asp.net/ajax上传控件,我发现NeatUpload。 我无法找到一个在线演示它,但下载包并配备了演示。 我需要一些帮助我的服务器(Windows Server 2008)上安装它。
我随后在方向http://mumblestiltskin.blogspot.com/2009/10/using-neatupload-simple-setup.html (它们基本上是相同的,如随附NeatUpload二进制包的manual.htm方向) 。
到目前为止,我有
- 成功安装Brettle.Web.NeatUpload.dll到GAC使用GACUTIL。
- 加入我的web.config中引用(与版本和GUID)
- 复制演示文件和我的web应用程序(这是在IIS7注册),后面的代码
现在,当我浏览的网页,我得到一个asp.net服务器错误
Line 35: protected MultiFile multiFile;
Line 36: protected MultiFile multiFile2;
Line 37: protected InputFile inputFile;
和
error CS0246: The type or namespace name 'MultiFile' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'MultiFile' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'InputFile' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'InputFile' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'ProgressBar' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'ProgressBar' could not be found (are you missing a using directive or an assembly reference?)
现在我该怎么做? 我是否需要复制另一个DLL的地方,或某些文件? 我无法从文档看着办吧。
弄清楚了! 我部署控制SharePoint Web应用程序。 (下面,考虑SPVD为“SharePoint应用程序的虚拟目录”)。如果你不准备部署到Sharepoint网站,那么你会用,我已经使用了SharePoint的,而不是你的web应用程序的虚拟目录的根目录。 下面是我跟着得到演示页,我的服务器上运行的步骤。
首先,配置是不同的,如果您使用的是“web应用”而不是“的网站”。 我不会去到区别就在这里。 但在我的例子中,我配置一个简单的“网址”。 我不得不:
- 复制
Brettle.Web.NeatUpload.dll
到GAC在服务器上(看来Windows Server 2008上,你不必使用GACUTIL -只需将dll文件拷贝到%WINDIR%\大会还请注意,你必须做此服务器上;它不正确的,如果你尝试做在网络共享上工作)。 如果你不这样做,NeatUpload演示只是不会做任何事情。 你将有你这样做后,重新启动IIS中的网站。 - 一些导游说,你需要更新web.config中显示相应的版本和GUID,但我发现,我没有这样做,(你将在下面看到我的web.config) - 除非 - 你想使用在web.config中neatupload的部分配置。 因此,它是更好的只是把事情做对,你知道的。
该指南还表示使用的aspx页面的GUID和版本号,比如demo.aspx
,所以,替换此:
<%@ Register TagPrefix="Upload" Namespace="Brettle.Web.NeatUpload" Assembly="Brettle.Web.NeatUpload" %>
有了这个:
<%@ Register TagPrefix="Upload" Namespace="Brettle.Web.NeatUpload" Assembly="Brettle.Web.NeatUpload, Version=1.3.3798.663,Culture=neutral, PublicKeyToken=c95290d92c5893c8" %>
在复制整个目录NeatUpload-1.3.25\dotnet\app\bin
到SVPD\bin
。 它包含以下项目:
- Brettle.Web.NeatUpload.dll(你一样安装到GAC的一个)
- Brettle.Web.NeatUpload.GreyBoxProgressBar.dll
- Brettle.Web.NeatUpload.HashedInputFile.dll
- Hitone.Web.SqlServerUploader.dll
- 一个名为目录
en-US
(在这一个dll) - 另一个direcotry名为
fr
(在这一个dll) - 几个的.mdb数据库和Brettle.Web.NeatUpload.xml
- 引用添加到HTTP模块web应用的web.config文件(见下面的web.config样品)。
现在,你需要复制的目录: NeatUpload-1.3.25\dotnet\app\NeatUpload
到SPVD,并把它命名为NeatUpload
,让你有SVPD\NeatUpload
及其所有原始内容。 现在,该文件夹中,有您需要编辑两个文件: Progress.aspx
和SmoothProgress.aspx
。 在导游,我被告知使用的@声明,像这样的的GUID和版本号:
<%@ Page language="c#" AutoEventWireup="false" Inherits="Brettle.Web.NeatUpload.ProgressPage,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8" %>
<%@ Register TagPrefix="Upload" Namespace="Brettle.Web.NeatUpload" Assembly="Brettle.Web.NeatUpload, Version=1.3.3798.663,Culture=neutral, PublicKeyToken=c95290d92c5893c8" %>
这里是我把文件夹与演示页的web.config中。
<?xml version="1.0"?>
<configuration>
<configSections>
<!--You need this part so that you can have a neatupload configuration section. You will get .net errors if you try to add the configuration section without this part here.-->
<section name="neatUpload"
type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload"
allowLocation="true"
/>
</configSections>
<!--This is where you put your neatupload configuration preferences.-->
<neatUpload xmlns="http://www.brettle.com/neatupload/config/2008"
useHttpModule="true"
/>
<system.web>
<customErrors mode="Off"/>
<!-- Always required to use any of NeatUpload's features. Without it, ProgressBars won't display and MultiFile will look like a regular HtmlInputFile. -->
<httpModules>
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload,Version=1.3.3798.663,Culture=neutral,PublicKeyToken=c95290d92c5893c8" />
</httpModules>
<!-- Set these next 2 attributes large enough to accomodate the largest and longest running upload you want to support. Note that browsers and IIS typically don't support uploads larger than 2GB (2097151 KB). -->
<httpRuntime maxRequestLength="2097151" executionTimeout="999999"/>
<!-- Not required for NeatUpload but makes it easier to debug in VS. -->
<compilation debug="true"/>
</system.web>
<!-- For IIS7's Integrated Pipeline Mode which is used by the DefaultAppPool. -->
<system.webServer>
<security>
<requestFiltering>
<!-- Increased maxAllowedContentLength from default of 300MB. -->
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
<modules>
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload,Version=1.3.3798.663,Culture=neutral,PublicKeyToken=c95290d92c5893c8" preCondition="managedHandler"/>
</modules>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>
在安装软件包我使用的安装包是一些注意事项 http://neatupload.codeplex.com/releases/view/46086 -似乎有一些人,比如“二进制文件包”在HTTP:// neatupload。 codeplex.com/releases/view/59339 ,但目录结构是不同的,说明将没有多大意义。 还有一个在CodePlex上的主要项目页面上的包: http://neatupload.codeplex.com/ ,但如果你使用这个包,你将不得不为DLL一个不同的版本号和GUID当你将其部署到GAC 。
使用说明书通过指导手册的方式,检查出: http://mumblestiltskin.blogspot.com/2009/10/using-neatupload-simple-setup.html?showComment=1335835416022#c1846924755786832325 ,而且也有在HTML手册上面的二进制文件包。 在其他的包,你要“建”与开放式办公室的手册。 然后,当然,你可以参考这个职位!
故障排除有问题吗?
- 如何克服这种NeatUpload对象引用错误?
- NeatUpload Nabble论坛: http://neatupload-help.688956.n3.nabble.com/
现在剩下的唯一的事情,是添加某种处理的用于复制文件到您想要的地方。 NeatUpload只将它们添加到一个临时文件,我还没有搞清楚它在哪里?