Skip to content

Commit fdb73d0

Browse files
author
Tomas Kirda
committed
Initial commit
1 parent 161a5cf commit fdb73d0

25 files changed

+13047
-0
lines changed

Html5Upload.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Html5UploadDemo", "Html5UploadDemo\Html5UploadDemo.csproj", "{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}"
5+
EndProject
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{28DF863F-1455-4237-9198-6991685B9736}"
7+
ProjectSection(SolutionItems) = preProject
8+
README.md = README.md
9+
EndProjectSection
10+
EndProject
11+
Global
12+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
13+
Debug|Any CPU = Debug|Any CPU
14+
Release|Any CPU = Release|Any CPU
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
GlobalSection(SolutionProperties) = preSolution
23+
HideSolutionNode = FALSE
24+
EndGlobalSection
25+
EndGlobal
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; }
2+
.body { width: 800px; margin: 10px auto; }
3+
4+
/* Upload image dialog */
5+
.uploadimage-dragndrop { border: 2px dashed #DDD; margin: 20px 0; padding: 50px 20px; text-align: center; color: #DDD; }
6+
.uploadimage-text { font-size: 32px; margin-bottom: 20px; }
7+
.uploadimage-input { margin: 20px 0; }
8+
.uploadimage-upload { background: #EEE; margin: 4px 0; }
9+
.uploadimage-uploadcompleted { background: #d1f4ac; }
10+
.uploadimage-fileinfo { padding: 5px; font-size: 11px; position: relative; }
11+
.uploadimage-progresspct { position: absolute; top: 5px; right: 5px; }
12+
.uploadimage-progress { background: #999; }
13+
.uploadimage-progressbar { background: maroon; height: 2px; }
14+
.uploadimage-totalprogress { background: #999; }
15+
.uploadimage-totalprogressbar { background: #107EC2; height: 6px; }
16+
17+
.description { margin: 40px 0; }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Web;
2+
using System.Web.Mvc;
3+
4+
namespace Html5UploadDemo.Controllers
5+
{
6+
public class FileController : Controller
7+
{
8+
public ActionResult Upload(HttpPostedFileBase file)
9+
{
10+
return Json(new
11+
{
12+
Success = true,
13+
FileName = file.FileName,
14+
FileSize = file.ContentLength
15+
}, JsonRequestBehavior.AllowGet);
16+
}
17+
18+
}
19+
}

Html5UploadDemo/Global.asax

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="Html5UploadDemo.MvcApplication" Language="C#" %>

Html5UploadDemo/Global.asax.cs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Web.Mvc;
2+
using System.Web.Routing;
3+
4+
namespace Html5UploadDemo
5+
{
6+
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
7+
// visit http://go.microsoft.com/?LinkId=9394801
8+
9+
public class MvcApplication : System.Web.HttpApplication
10+
{
11+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
12+
{
13+
filters.Add(new HandleErrorAttribute());
14+
}
15+
16+
public static void RegisterRoutes(RouteCollection routes)
17+
{
18+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
19+
routes.IgnoreRoute("{resource}.html");
20+
21+
routes.MapRoute(
22+
"Default", // Route name
23+
"file/upload", // URL with parameters
24+
new { controller = "File", action = "Upload", id = UrlParameter.Optional } // Parameter defaults
25+
);
26+
27+
}
28+
29+
protected void Application_Start()
30+
{
31+
//AreaRegistration.RegisterAllAreas();
32+
33+
//RegisterGlobalFilters(GlobalFilters.Filters);
34+
RegisterRoutes(RouteTable.Routes);
35+
}
36+
}
37+
}
+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProductVersion>
8+
</ProductVersion>
9+
<SchemaVersion>2.0</SchemaVersion>
10+
<ProjectGuid>{C4D1CC8C-E3B1-4371-A71C-0BA22658C8C7}</ProjectGuid>
11+
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
12+
<OutputType>Library</OutputType>
13+
<AppDesignerFolder>Properties</AppDesignerFolder>
14+
<RootNamespace>Html5UploadDemo</RootNamespace>
15+
<AssemblyName>Html5UploadDemo</AssemblyName>
16+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
17+
<MvcBuildViews>false</MvcBuildViews>
18+
<UseIISExpress>true</UseIISExpress>
19+
<IISExpressSSLPort />
20+
<IISExpressAnonymousAuthentication />
21+
<IISExpressWindowsAuthentication />
22+
<IISExpressUseClassicPipelineMode />
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25+
<DebugSymbols>true</DebugSymbols>
26+
<DebugType>full</DebugType>
27+
<Optimize>false</Optimize>
28+
<OutputPath>bin\</OutputPath>
29+
<DefineConstants>DEBUG;TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<Reference Include="System.Data.Entity" />
43+
<Reference Include="Microsoft.CSharp" />
44+
<Reference Include="System" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Drawing" />
47+
<Reference Include="System.Web.DynamicData" />
48+
<Reference Include="System.Web.Entity" />
49+
<Reference Include="System.Web.ApplicationServices" />
50+
<Reference Include="System.ComponentModel.DataAnnotations" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Data.DataSetExtensions" />
53+
<Reference Include="System.Xml.Linq" />
54+
<Reference Include="System.Web" />
55+
<Reference Include="System.Web.Extensions" />
56+
<Reference Include="System.Web.Abstractions" />
57+
<Reference Include="System.Web.Routing" />
58+
<Reference Include="System.Xml" />
59+
<Reference Include="System.Configuration" />
60+
<Reference Include="System.Web.Services" />
61+
<Reference Include="System.EnterpriseServices" />
62+
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63+
<Private>True</Private>
64+
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
65+
</Reference>
66+
<Reference Include="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67+
<Private>True</Private>
68+
<HintPath>..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.Helpers.dll</HintPath>
69+
</Reference>
70+
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<Private>True</Private>
72+
<HintPath>..\packages\Microsoft.AspNet.Mvc.3.0.20105.1\lib\net40\System.Web.Mvc.dll</HintPath>
73+
</Reference>
74+
<Reference Include="System.Web.Providers">
75+
<HintPath>..\packages\Microsoft.AspNet.Providers.Core.1.0\lib\net40\System.Web.Providers.dll</HintPath>
76+
</Reference>
77+
<Reference Include="System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
78+
<Private>True</Private>
79+
<HintPath>..\packages\Microsoft.AspNet.Razor.1.0.20105.408\lib\net40\System.Web.Razor.dll</HintPath>
80+
</Reference>
81+
<Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
82+
<Private>True</Private>
83+
<HintPath>..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.dll</HintPath>
84+
</Reference>
85+
<Reference Include="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86+
<Private>True</Private>
87+
<HintPath>..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
88+
</Reference>
89+
<Reference Include="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
90+
<Private>True</Private>
91+
<HintPath>..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
92+
</Reference>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<Compile Include="Controllers\FileController.cs" />
96+
<Compile Include="Global.asax.cs">
97+
<DependentUpon>Global.asax</DependentUpon>
98+
</Compile>
99+
<Compile Include="Properties\AssemblyInfo.cs" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<Content Include="Content\styles\styles.css" />
103+
<Content Include="Global.asax" />
104+
<Content Include="index.html" />
105+
<Content Include="packages.config" />
106+
<None Include="Scripts\jquery-1.8.2.intellisense.js">
107+
<DependentUpon>jquery-1.8.2.js</DependentUpon>
108+
</None>
109+
<Content Include="Scripts\domReady.js" />
110+
<Content Include="Scripts\jquery-1.8.2.js" />
111+
<Content Include="Scripts\jquery-1.8.2.min.js">
112+
<DependentUpon>jquery-1.8.2.js</DependentUpon>
113+
</Content>
114+
<Content Include="Scripts\knockout-2.1.0.js" />
115+
<Content Include="Scripts\main.js" />
116+
<Content Include="Scripts\require.js" />
117+
<Content Include="Scripts\src\html5Upload.js" />
118+
<Content Include="Web.config" />
119+
<Content Include="Web.Debug.config">
120+
<DependentUpon>Web.config</DependentUpon>
121+
</Content>
122+
<Content Include="Web.Release.config">
123+
<DependentUpon>Web.config</DependentUpon>
124+
</Content>
125+
<Content Include="Views\Web.config" />
126+
<Content Include="Views\_ViewStart.cshtml" />
127+
<Content Include="Views\Shared\Error.cshtml" />
128+
<Content Include="Views\Shared\_Layout.cshtml" />
129+
</ItemGroup>
130+
<ItemGroup />
131+
<PropertyGroup>
132+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
133+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
134+
</PropertyGroup>
135+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
136+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
137+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
138+
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
139+
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
140+
</Target>
141+
<ProjectExtensions>
142+
<VisualStudio>
143+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
144+
<WebProjectProperties>
145+
<UseIIS>True</UseIIS>
146+
<AutoAssignPort>True</AutoAssignPort>
147+
<DevelopmentServerPort>0</DevelopmentServerPort>
148+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
149+
<IISUrl>http://localhost:3071/</IISUrl>
150+
<NTLMAuthentication>False</NTLMAuthentication>
151+
<UseCustomServer>False</UseCustomServer>
152+
<CustomServerUrl>
153+
</CustomServerUrl>
154+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
155+
</WebProjectProperties>
156+
</FlavorProperties>
157+
</VisualStudio>
158+
</ProjectExtensions>
159+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
160+
Other similar extension points exist, see Microsoft.Common.targets.
161+
<Target Name="BeforeBuild">
162+
</Target>
163+
<Target Name="AfterBuild">
164+
</Target> -->
165+
</Project>
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Html5UploadDemo")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Html5UploadDemo")]
13+
[assembly: AssemblyCopyright("Copyright © 2012")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("26c33285-b6b7-437a-8e7e-2f218516fcb7")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Revision and Build Numbers
33+
// by using the '*' as shown below:
34+
[assembly: AssemblyVersion("1.0.0.0")]
35+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)