├── .gitignore
├── BackEnd
├── .vscode
│ ├── launch.json
│ └── tasks.json
├── BackEnd.csproj
├── Controllers
│ └── UploadDownloadController.cs
├── Program.cs
├── Properties
│ └── launchSettings.json
├── Startup.cs
├── appsettings.Development.json
├── appsettings.json
└── wwwroot
│ └── .gitignore
├── FrontEnd
├── .editorconfig
├── README.md
├── angular.json
├── e2e
│ ├── src
│ │ ├── app.e2e-spec.ts
│ │ └── app.po.ts
│ └── tsconfig.e2e.json
├── package-lock.json
├── package.json
├── src
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── components
│ │ │ ├── download
│ │ │ │ ├── download.component.html
│ │ │ │ └── download.component.ts
│ │ │ ├── file-manager
│ │ │ │ ├── file-manager.component.html
│ │ │ │ └── file-manager.component.ts
│ │ │ └── upload
│ │ │ │ ├── upload.component.html
│ │ │ │ └── upload.component.ts
│ │ ├── models
│ │ │ └── progress-status.model.ts
│ │ └── services
│ │ │ └── upload-download.service.ts
│ ├── assets
│ │ └── .gitkeep
│ ├── browserslist
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── karma.conf.js
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles.css
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── tsconfig.json
└── tslint.json
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ### Angular ###
2 | ## Angular ##
3 | # compiled output
4 | /FrontEnd/dist
5 | /FrontEnd/tmp
6 | /FrontEnd/out-tsc
7 | /FrontEnd/app/**/*.js
8 | /FrontEnd/app/**/*.js.map
9 |
10 | # dependencies
11 | /FrontEnd/node_modules
12 | /FrontEnd/bower_components
13 |
14 | # IDEs and editors
15 | /FrontEnd/.idea
16 |
17 | # misc
18 | /FrontEnd/.sass-cache
19 | /FrontEnd/connect.lock
20 | /FrontEnd/coverage/*
21 | /FrontEnd/libpeerconnection.log
22 | /FrontEnd/npm-debug.log
23 | /FrontEnd/testem.log
24 | /FrontEnd/typings
25 |
26 | # e2e
27 | /FrontEnd/e2e/*.js
28 | /FrontEnd/e2e/*.map
29 |
30 | #System Files
31 | /FrontEnd/.DS_Store
32 |
33 | ### ASPNETCore ###
34 | ## Ignore Visual Studio temporary files, build results, and
35 | ## files generated by popular Visual Studio add-ons.
36 |
37 | # User-specific files
38 | /BackEnd/*.suo
39 | /BackEnd/*.user
40 | /BackEnd/*.userosscache
41 | /BackEnd/*.sln.docstates
42 |
43 | # User-specific files (MonoDevelop/Xamarin Studio)
44 | /BackEnd/*.userprefs
45 |
46 | # Build results
47 | /BackEnd/[Dd]ebug/
48 | /BackEnd/[Dd]ebugPublic/
49 | /BackEnd/[Rr]elease/
50 | /BackEnd/[Rr]eleases/
51 | /BackEnd/x64/
52 | /BackEnd/x86/
53 | /BackEnd/bld/
54 | /BackEnd/[Bb]in/
55 | /BackEnd/[Oo]bj/
56 | /BackEnd/[Ll]og/
57 |
58 | # Visual Studio 2015 cache/options directory
59 | /BackEnd/.vs/
60 | # Uncomment if you have tasks that create the project's static files in wwwroot
61 | #wwwroot/
62 |
63 | # MSTest test Results
64 | /BackEnd/[Tt]est[Rr]esult*/
65 | /BackEnd/[Bb]uild[Ll]og.*
66 |
67 | # NUNIT
68 | /BackEnd/*.VisualState.xml
69 | /BackEnd/TestResult.xml
70 |
71 | # Build Results of an ATL Project
72 | /BackEnd/[Dd]ebugPS/
73 | /BackEnd/[Rr]eleasePS/
74 | /BackEnd/dlldata.c
75 |
76 | # DNX
77 | /BackEnd/project.lock.json
78 | /BackEnd/project.fragment.lock.json
79 | /BackEnd/artifacts/
80 |
81 | /BackEnd/*_i.c
82 | /BackEnd/*_p.c
83 | /BackEnd/*_i.h
84 | /BackEnd/*.ilk
85 | /BackEnd/*.meta
86 | /BackEnd/*.obj
87 | /BackEnd/*.pch
88 | /BackEnd/*.pdb
89 | /BackEnd/*.pgc
90 | /BackEnd/*.pgd
91 | /BackEnd/*.rsp
92 | /BackEnd/*.sbr
93 | /BackEnd/*.tlb
94 | /BackEnd/*.tli
95 | /BackEnd/*.tlh
96 | /BackEnd/*.tmp
97 | /BackEnd/*.tmp_proj
98 | /BackEnd/*.log
99 | /BackEnd/*.vspscc
100 | /BackEnd/*.vssscc
101 | /BackEnd/.builds
102 | /BackEnd/*.pidb
103 | /BackEnd/*.svclog
104 | /BackEnd/*.scc
105 |
106 | # Chutzpah Test files
107 | /BackEnd/_Chutzpah*
108 |
109 | # Visual C++ cache files
110 | /BackEnd/ipch/
111 | /BackEnd/*.aps
112 | /BackEnd/*.ncb
113 | /BackEnd/*.opendb
114 | /BackEnd/*.opensdf
115 | /BackEnd/*.sdf
116 | /BackEnd/*.cachefile
117 | /BackEnd/*.VC.db
118 | /BackEnd/*.VC.VC.opendb
119 |
120 | # Visual Studio profiler
121 | /BackEnd/*.psess
122 | /BackEnd/*.vsp
123 | /BackEnd/*.vspx
124 | /BackEnd/*.sap
125 |
126 | # TFS 2012 Local Workspace
127 | /BackEnd/$tf/
128 |
129 | # Guidance Automation Toolkit
130 | /BackEnd/*.gpState
131 |
132 | # ReSharper is a .NET coding add-in
133 | /BackEnd/_ReSharper*/
134 | /BackEnd/*.[Rr]e[Ss]harper
135 | /BackEnd/*.DotSettings.user
136 |
137 | # JustCode is a .NET coding add-in
138 | /BackEnd/.JustCode
139 |
140 | # TeamCity is a build add-in
141 | /BackEnd/_TeamCity*
142 |
143 | # DotCover is a Code Coverage Tool
144 | /BackEnd/*.dotCover
145 |
146 | # Visual Studio code coverage results
147 | /BackEnd/*.coverage
148 | /BackEnd/*.coveragexml
149 |
150 | # NCrunch
151 | /BackEnd/_NCrunch_*
152 | /BackEnd/.*crunch*.local.xml
153 | /BackEnd/nCrunchTemp_*
154 |
155 | # MightyMoose
156 | /BackEnd/*.mm.*
157 | /BackEnd/AutoTest.Net/
158 |
159 | # Web workbench (sass)
160 | /BackEnd/.sass-cache/
161 |
162 | # Installshield output folder
163 | /BackEnd/[Ee]xpress/
164 |
165 | # DocProject is a documentation generator add-in
166 | /BackEnd/DocProject/buildhelp/
167 | /BackEnd/DocProject/Help/*.HxT
168 | /BackEnd/DocProject/Help/*.HxC
169 | /BackEnd/DocProject/Help/*.hhc
170 | /BackEnd/DocProject/Help/*.hhk
171 | /BackEnd/DocProject/Help/*.hhp
172 | /BackEnd/DocProject/Help/Html2
173 | /BackEnd/DocProject/Help/html
174 |
175 | # Click-Once directory
176 | /BackEnd/publish/
177 |
178 | # Publish Web Output
179 | /BackEnd/*.[Pp]ublish.xml
180 | /BackEnd/*.azurePubxml
181 | # TODO: Comment the next line if you want to checkin your web deploy settings
182 | # but database connection strings (with potential passwords) will be unencrypted
183 | /BackEnd/*.pubxml
184 | /BackEnd/*.publishproj
185 |
186 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
187 | # checkin your Azure Web App publish settings, but sensitive information contained
188 | # in these scripts will be unencrypted
189 | /BackEnd/PublishScripts/
190 |
191 | # NuGet Packages
192 | /BackEnd/*.nupkg
193 | # The packages folder can be ignored because of Package Restore
194 | /BackEnd/**/packages/*
195 | # except build/, which is used as an MSBuild target.
196 | /BackEnd/!**/packages/build/
197 | # Uncomment if necessary however generally it will be regenerated when needed
198 | #!**/packages/repositories.config
199 | # NuGet v3's project.json files produces more ignoreable files
200 | /BackEnd/*.nuget.props
201 | /BackEnd/*.nuget.targets
202 |
203 | # Microsoft Azure Build Output
204 | /BackEnd/csx/
205 | /BackEnd/*.build.csdef
206 |
207 | # Microsoft Azure Emulator
208 | /BackEnd/ecf/
209 | /BackEnd/rcf/
210 |
211 | # Windows Store app package directories and files
212 | /BackEnd/AppPackages/
213 | /BackEnd/BundleArtifacts/
214 | /BackEnd/Package.StoreAssociation.xml
215 | /BackEnd/_pkginfo.txt
216 |
217 | # Visual Studio cache files
218 | # files ending in .cache can be ignored
219 | /BackEnd/*.[Cc]ache
220 | # but keep track of directories ending in .cache
221 | /BackEnd/!*.[Cc]ache/
222 |
223 | # Others
224 | /BackEnd/ClientBin/
225 | /BackEnd/~$*
226 | /BackEnd/*~
227 | /BackEnd/*.dbmdl
228 | /BackEnd/*.dbproj.schemaview
229 | /BackEnd/*.jfm
230 | /BackEnd/*.pfx
231 | /BackEnd/*.publishsettings
232 | /BackEnd/node_modules/
233 | /BackEnd/orleans.codegen.cs
234 |
235 | # Since there are multiple workflows, uncomment next line to ignore bower_components
236 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
237 | #bower_components/
238 |
239 | # RIA/Silverlight projects
240 | /BackEnd/Generated_Code/
241 |
242 | # Backup & report files from converting an old project file
243 | # to a newer Visual Studio version. Backup files are not needed,
244 | # because we have git ;-)
245 | /BackEnd/_UpgradeReport_Files/
246 | /BackEnd/Backup*/
247 | /BackEnd/UpgradeLog*.XML
248 | /BackEnd/UpgradeLog*.htm
249 |
250 | # SQL Server files
251 | /BackEnd/*.mdf
252 | /BackEnd/*.ldf
253 |
254 | # Business Intelligence projects
255 | /BackEnd/*.rdl.data
256 | /BackEnd/*.bim.layout
257 | /BackEnd/*.bim_*.settings
258 |
259 | # Microsoft Fakes
260 | /BackEnd/FakesAssemblies/
261 |
262 | # GhostDoc plugin setting file
263 | /BackEnd/*.GhostDoc.xml
264 |
265 | # Node.js Tools for Visual Studio
266 | /BackEnd/.ntvs_analysis.dat
267 |
268 | # Visual Studio 6 build log
269 | /BackEnd/*.plg
270 |
271 | # Visual Studio 6 workspace options file
272 | /BackEnd/*.opt
273 |
274 | # Visual Studio LightSwitch build output
275 | /BackEnd/**/*.HTMLClient/GeneratedArtifacts
276 | /BackEnd/**/*.DesktopClient/GeneratedArtifacts
277 | /BackEnd/**/*.DesktopClient/ModelManifest.xml
278 | /BackEnd/**/*.Server/GeneratedArtifacts
279 | /BackEnd/**/*.Server/ModelManifest.xml
280 | /BackEnd/_Pvt_Extensions
281 |
282 | # Paket dependency manager
283 | /BackEnd/.paket/paket.exe
284 | /BackEnd/paket-files/
285 |
286 | # FAKE - F# Make
287 | /BackEnd/.fake/
288 |
289 | # JetBrains Rider
290 | /BackEnd/.idea/
291 | /BackEnd/*.sln.iml
292 |
293 | # CodeRush
294 | /BackEnd/.cr/
295 |
296 | # Python Tools for Visual Studio (PTVS)
297 | /BackEnd/__pycache__/
298 | /BackEnd/*.pyc
299 |
300 | # Cake - Uncomment if you are using it
301 | # tools/
302 |
303 | /BackEnd/wwwroot/uploads
--------------------------------------------------------------------------------
/BackEnd/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": ".NET Core Launch (web)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/BackEnd.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}",
16 | "stopAtEntry": false,
17 | "internalConsoleOptions": "openOnSessionStart",
18 | "launchBrowser": {
19 | "enabled": true,
20 | "args": "${auto-detect-url}",
21 | "windows": {
22 | "command": "cmd.exe",
23 | "args": "/C start ${auto-detect-url}"
24 | },
25 | "osx": {
26 | "command": "open"
27 | },
28 | "linux": {
29 | "command": "xdg-open"
30 | }
31 | },
32 | "env": {
33 | "ASPNETCORE_ENVIRONMENT": "Development"
34 | },
35 | "sourceFileMap": {
36 | "/Views": "${workspaceFolder}/Views"
37 | }
38 | },
39 | {
40 | "name": ".NET Core Attach",
41 | "type": "coreclr",
42 | "request": "attach",
43 | "processId": "${command:pickProcess}"
44 | }
45 | ,]
46 | }
--------------------------------------------------------------------------------
/BackEnd/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/BackEnd.csproj"
11 | ],
12 | "problemMatcher": "$msCompile"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/BackEnd/BackEnd.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BackEnd/Controllers/UploadDownloadController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.AspNetCore.Http;
9 | using Microsoft.AspNetCore.Mvc;
10 | using Microsoft.AspNetCore.StaticFiles;
11 |
12 | namespace BackEnd.Controllers
13 | {
14 | [Route("api")]
15 | [ApiController]
16 | public class UploadDownloadController: ControllerBase
17 | {
18 | private IHostingEnvironment _hostingEnvironment;
19 |
20 | public UploadDownloadController(IHostingEnvironment environment) {
21 | _hostingEnvironment = environment;
22 | }
23 |
24 | [HttpPost]
25 | [Route("upload")]
26 | public async Task Upload(IFormFile file)
27 | {
28 | var uploads = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
29 | if(!Directory.Exists(uploads))
30 | {
31 | Directory.CreateDirectory(uploads);
32 | }
33 | if (file.Length > 0) {
34 | var filePath = Path.Combine(uploads, file.FileName);
35 | using (var fileStream = new FileStream(filePath, FileMode.Create)) {
36 | await file.CopyToAsync(fileStream);
37 | }
38 | }
39 | return Ok();
40 | }
41 |
42 | [HttpGet]
43 | [Route("download")]
44 | public async Task Download([FromQuery] string file) {
45 | var uploads = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
46 | var filePath = Path.Combine(uploads, file);
47 | if (!System.IO.File.Exists(filePath))
48 | return NotFound();
49 |
50 | var memory = new MemoryStream();
51 | using (var stream = new FileStream(filePath, FileMode.Open))
52 | {
53 | await stream.CopyToAsync(memory);
54 | }
55 | memory.Position = 0;
56 |
57 | return File(memory, GetContentType(filePath), file);
58 | }
59 |
60 | [HttpGet]
61 | [Route("files")]
62 | public IActionResult Files() {
63 | var result = new List();
64 |
65 | var uploads = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
66 | if(Directory.Exists(uploads))
67 | {
68 | var provider = _hostingEnvironment.ContentRootFileProvider;
69 | foreach (string fileName in Directory.GetFiles(uploads))
70 | {
71 | var fileInfo = provider.GetFileInfo(fileName);
72 | result.Add(fileInfo.Name);
73 | }
74 | }
75 | return Ok(result);
76 | }
77 |
78 |
79 | private string GetContentType(string path)
80 | {
81 | var provider = new FileExtensionContentTypeProvider();
82 | string contentType;
83 | if(!provider.TryGetContentType(path, out contentType))
84 | {
85 | contentType = "application/octet-stream";
86 | }
87 | return contentType;
88 | }
89 | }
90 | }
--------------------------------------------------------------------------------
/BackEnd/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace BackEnd
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/BackEnd/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:61759",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "IIS Express": {
13 | "commandName": "IISExpress",
14 | "launchBrowser": false,
15 | "launchUrl": "api/values",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "BackEnd": {
21 | "commandName": "Project",
22 | "launchBrowser": false,
23 | "launchUrl": "api/values",
24 | "applicationUrl": "http://localhost:5001",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/BackEnd/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.HttpsPolicy;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Logging;
12 | using Microsoft.Extensions.Options;
13 |
14 | namespace BackEnd
15 | {
16 | public class Startup
17 | {
18 | public Startup(IConfiguration configuration)
19 | {
20 | Configuration = configuration;
21 | }
22 |
23 | public IConfiguration Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | services.AddCors();
29 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);;
30 | }
31 |
32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
33 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
34 | {
35 | app.UseCors(b =>
36 | b.AllowAnyOrigin()
37 | .AllowAnyMethod()
38 | .AllowAnyHeader());
39 | app.UseMvc();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/BackEnd/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/BackEnd/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "AllowedHosts": "*"
8 | }
9 |
--------------------------------------------------------------------------------
/BackEnd/wwwroot/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
--------------------------------------------------------------------------------
/FrontEnd/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/FrontEnd/README.md:
--------------------------------------------------------------------------------
1 | # FrontEnd
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.5.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28 |
--------------------------------------------------------------------------------
/FrontEnd/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "FrontEnd": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {},
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/FrontEnd",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | "src/favicon.ico",
23 | "src/assets"
24 | ],
25 | "styles": [
26 | "src/styles.css"
27 | ],
28 | "scripts": []
29 | },
30 | "configurations": {
31 | "production": {
32 | "fileReplacements": [
33 | {
34 | "replace": "src/environments/environment.ts",
35 | "with": "src/environments/environment.prod.ts"
36 | }
37 | ],
38 | "optimization": true,
39 | "outputHashing": "all",
40 | "sourceMap": false,
41 | "extractCss": true,
42 | "namedChunks": false,
43 | "aot": true,
44 | "extractLicenses": true,
45 | "vendorChunk": false,
46 | "buildOptimizer": true,
47 | "budgets": [
48 | {
49 | "type": "initial",
50 | "maximumWarning": "2mb",
51 | "maximumError": "5mb"
52 | }
53 | ]
54 | }
55 | }
56 | },
57 | "serve": {
58 | "builder": "@angular-devkit/build-angular:dev-server",
59 | "options": {
60 | "browserTarget": "FrontEnd:build"
61 | },
62 | "configurations": {
63 | "production": {
64 | "browserTarget": "FrontEnd:build:production"
65 | }
66 | }
67 | },
68 | "extract-i18n": {
69 | "builder": "@angular-devkit/build-angular:extract-i18n",
70 | "options": {
71 | "browserTarget": "FrontEnd:build"
72 | }
73 | },
74 | "test": {
75 | "builder": "@angular-devkit/build-angular:karma",
76 | "options": {
77 | "main": "src/test.ts",
78 | "polyfills": "src/polyfills.ts",
79 | "tsConfig": "src/tsconfig.spec.json",
80 | "karmaConfig": "src/karma.conf.js",
81 | "styles": [
82 | "src/styles.css"
83 | ],
84 | "scripts": [],
85 | "assets": [
86 | "src/favicon.ico",
87 | "src/assets"
88 | ]
89 | }
90 | },
91 | "lint": {
92 | "builder": "@angular-devkit/build-angular:tslint",
93 | "options": {
94 | "tsConfig": [
95 | "src/tsconfig.app.json",
96 | "src/tsconfig.spec.json"
97 | ],
98 | "exclude": [
99 | "**/node_modules/**"
100 | ]
101 | }
102 | }
103 | }
104 | },
105 | "FrontEnd-e2e": {
106 | "root": "e2e/",
107 | "projectType": "application",
108 | "prefix": "",
109 | "architect": {
110 | "e2e": {
111 | "builder": "@angular-devkit/build-angular:protractor",
112 | "options": {
113 | "protractorConfig": "e2e/protractor.conf.js",
114 | "devServerTarget": "FrontEnd:serve"
115 | },
116 | "configurations": {
117 | "production": {
118 | "devServerTarget": "FrontEnd:serve:production"
119 | }
120 | }
121 | },
122 | "lint": {
123 | "builder": "@angular-devkit/build-angular:tslint",
124 | "options": {
125 | "tsConfig": "e2e/tsconfig.e2e.json",
126 | "exclude": [
127 | "**/node_modules/**"
128 | ]
129 | }
130 | }
131 | }
132 | }
133 | },
134 | "defaultProject": "FrontEnd"
135 | }
--------------------------------------------------------------------------------
/FrontEnd/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('workspace-project App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to FrontEnd!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/FrontEnd/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/FrontEnd/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/FrontEnd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "front-end",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e"
11 | },
12 | "private": true,
13 | "dependencies": {
14 | "@angular/animations": "~7.0.0",
15 | "@angular/common": "~7.0.0",
16 | "@angular/compiler": "~7.0.0",
17 | "@angular/core": "~7.0.0",
18 | "@angular/forms": "~7.0.0",
19 | "@angular/http": "~7.0.0",
20 | "@angular/platform-browser": "~7.0.0",
21 | "@angular/platform-browser-dynamic": "~7.0.0",
22 | "@angular/router": "~7.0.0",
23 | "core-js": "^2.5.4",
24 | "rxjs": "~6.3.3",
25 | "zone.js": "~0.8.26"
26 | },
27 | "devDependencies": {
28 | "@angular-devkit/build-angular": "~0.10.0",
29 | "@angular/cli": "~7.0.5",
30 | "@angular/compiler-cli": "~7.0.0",
31 | "@angular/language-service": "~7.0.0",
32 | "@types/node": "~8.9.4",
33 | "@types/jasmine": "~2.8.8",
34 | "@types/jasminewd2": "~2.0.3",
35 | "codelyzer": "~4.5.0",
36 | "jasmine-core": "~2.99.1",
37 | "jasmine-spec-reporter": "~4.2.1",
38 | "karma": "~3.0.0",
39 | "karma-chrome-launcher": "~2.2.0",
40 | "karma-coverage-istanbul-reporter": "~2.0.1",
41 | "karma-jasmine": "~1.1.2",
42 | "karma-jasmine-html-reporter": "^0.2.2",
43 | "protractor": "~5.4.0",
44 | "ts-node": "~7.0.0",
45 | "tslint": "~5.11.0",
46 | "typescript": "~3.1.6"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/app.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AARNOLD87/down-up-load-with-angular/60fdf9235c92c5dad01f36e9bb010e144cecc022/FrontEnd/src/app/app.component.css
--------------------------------------------------------------------------------
/FrontEnd/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { RouterTestingModule } from '@angular/router/testing';
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async(() => {
7 | TestBed.configureTestingModule({
8 | imports: [
9 | RouterTestingModule
10 | ],
11 | declarations: [
12 | AppComponent
13 | ],
14 | }).compileComponents();
15 | }));
16 |
17 | it('should create the app', () => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.debugElement.componentInstance;
20 | expect(app).toBeTruthy();
21 | });
22 |
23 | it(`should have as title 'FrontEnd'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.debugElement.componentInstance;
26 | expect(app.title).toEqual('FrontEnd');
27 | });
28 |
29 | it('should render title in a h1 tag', () => {
30 | const fixture = TestBed.createComponent(AppComponent);
31 | fixture.detectChanges();
32 | const compiled = fixture.debugElement.nativeElement;
33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to FrontEnd!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {
9 | title = 'FrontEnd';
10 | }
11 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { AppComponent } from './app.component';
4 | import { UploadDownloadService } from './services/upload-download.service';
5 | import { HttpClientModule } from '@angular/common/http';
6 | import { UploadComponent } from './components/upload/upload.component';
7 | import { DownloadComponent } from './components/download/download.component';
8 | import { FileManagerComponent } from './components/file-manager/file-manager.component';
9 |
10 | @NgModule({
11 | declarations: [
12 | AppComponent,
13 | FileManagerComponent,
14 | UploadComponent,
15 | DownloadComponent
16 | ],
17 | imports: [
18 | BrowserModule,
19 | HttpClientModule
20 | ],
21 | providers: [ UploadDownloadService ],
22 | bootstrap: [AppComponent]
23 | })
24 | export class AppModule { }
25 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/download/download.component.html:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/download/download.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, Input, Output, EventEmitter } from '@angular/core';
2 | import { HttpEventType } from '@angular/common/http';
3 | import { UploadDownloadService } from 'src/app/services/upload-download.service';
4 | import { ProgressStatus, ProgressStatusEnum } from 'src/app/models/progress-status.model';
5 |
6 | @Component({
7 | selector: 'app-download',
8 | templateUrl: 'download.component.html'
9 | })
10 |
11 | export class DownloadComponent {
12 | @Input() public disabled: boolean;
13 | @Input() public fileName: string;
14 | @Output() public downloadStatus: EventEmitter;
15 |
16 | constructor(private service: UploadDownloadService) {
17 | this.downloadStatus = new EventEmitter();
18 | }
19 |
20 | public download() {
21 | this.downloadStatus.emit( {status: ProgressStatusEnum.START});
22 | this.service.downloadFile(this.fileName).subscribe(
23 | data => {
24 | switch (data.type) {
25 | case HttpEventType.DownloadProgress:
26 | this.downloadStatus.emit( {status: ProgressStatusEnum.IN_PROGRESS, percentage: Math.round((data.loaded / data.total) * 100)});
27 | break;
28 | case HttpEventType.Response:
29 | this.downloadStatus.emit( {status: ProgressStatusEnum.COMPLETE});
30 | const downloadedFile = new Blob([data.body], { type: data.body.type });
31 | const a = document.createElement('a');
32 | a.setAttribute('style', 'display:none;');
33 | document.body.appendChild(a);
34 | a.download = this.fileName;
35 | a.href = URL.createObjectURL(downloadedFile);
36 | a.target = '_blank';
37 | a.click();
38 | document.body.removeChild(a);
39 | break;
40 | }
41 | },
42 | error => {
43 | this.downloadStatus.emit( {status: ProgressStatusEnum.ERROR});
44 | }
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/file-manager/file-manager.component.html:
--------------------------------------------------------------------------------
1 |
2 | File List
3 | progress {{percentage}}%
4 |
5 |
6 |
7 |
17 |
18 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/file-manager/file-manager.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { UploadDownloadService } from 'src/app/services/upload-download.service';
3 | import { ProgressStatusEnum, ProgressStatus } from 'src/app/models/progress-status.model';
4 |
5 | @Component({
6 | selector: 'app-filemanager',
7 | templateUrl: './file-manager.component.html'
8 | })
9 | export class FileManagerComponent implements OnInit {
10 |
11 | public files: string[];
12 | public fileInDownload: string;
13 | public percentage: number;
14 | public showProgress: boolean;
15 | public showDownloadError: boolean;
16 | public showUploadError: boolean;
17 |
18 | constructor(private service: UploadDownloadService) { }
19 |
20 | ngOnInit() {
21 | this.getFiles();
22 | }
23 |
24 | private getFiles() {
25 | this.service.getFiles().subscribe(
26 | data => {
27 | this.files = data;
28 | }
29 | );
30 | }
31 |
32 | public downloadStatus(event: ProgressStatus) {
33 | switch (event.status) {
34 | case ProgressStatusEnum.START:
35 | this.showDownloadError = false;
36 | break;
37 | case ProgressStatusEnum.IN_PROGRESS:
38 | this.showProgress = true;
39 | this.percentage = event.percentage;
40 | break;
41 | case ProgressStatusEnum.COMPLETE:
42 | this.showProgress = false;
43 | break;
44 | case ProgressStatusEnum.ERROR:
45 | this.showProgress = false;
46 | this.showDownloadError = true;
47 | break;
48 | }
49 | }
50 |
51 | public uploadStatus(event: ProgressStatus) {
52 | switch (event.status) {
53 | case ProgressStatusEnum.START:
54 | this.showUploadError = false;
55 | break;
56 | case ProgressStatusEnum.IN_PROGRESS:
57 | this.showProgress = true;
58 | this.percentage = event.percentage;
59 | break;
60 | case ProgressStatusEnum.COMPLETE:
61 | this.showProgress = false;
62 | this.getFiles();
63 | break;
64 | case ProgressStatusEnum.ERROR:
65 | this.showProgress = false;
66 | this.showUploadError = true;
67 | break;
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/upload/upload.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/components/upload/upload.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, Output, EventEmitter, Input, ViewChild, ElementRef } from '@angular/core';
2 | import { UploadDownloadService } from 'src/app/services/upload-download.service';
3 | import { HttpEventType } from '@angular/common/http';
4 | import { ProgressStatus, ProgressStatusEnum } from 'src/app/models/progress-status.model';
5 |
6 | @Component({
7 | selector: 'app-upload',
8 | templateUrl: 'upload.component.html'
9 | })
10 |
11 | export class UploadComponent {
12 | @Input() public disabled: boolean;
13 | @Output() public uploadStatus: EventEmitter;
14 | @ViewChild('inputFile') inputFile: ElementRef;
15 |
16 | constructor(private service: UploadDownloadService) {
17 | this.uploadStatus = new EventEmitter();
18 | }
19 |
20 | public upload(event) {
21 | if (event.target.files && event.target.files.length > 0) {
22 | const file = event.target.files[0];
23 | this.uploadStatus.emit( {status: ProgressStatusEnum.START});
24 | this.service.uploadFile(file).subscribe(
25 | data => {
26 | if (data) {
27 | switch (data.type) {
28 | case HttpEventType.UploadProgress:
29 | this.uploadStatus.emit( {status: ProgressStatusEnum.IN_PROGRESS, percentage: Math.round((data.loaded / data.total) * 100)});
30 | break;
31 | case HttpEventType.Response:
32 | this.inputFile.nativeElement.value = '';
33 | this.uploadStatus.emit( {status: ProgressStatusEnum.COMPLETE});
34 | break;
35 | }
36 | }
37 | },
38 | error => {
39 | this.inputFile.nativeElement.value = '';
40 | this.uploadStatus.emit( {status: ProgressStatusEnum.ERROR});
41 | }
42 | );
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/models/progress-status.model.ts:
--------------------------------------------------------------------------------
1 | export interface ProgressStatus {
2 | status: ProgressStatusEnum;
3 | percentage?: number;
4 | }
5 |
6 | export enum ProgressStatusEnum {
7 | START, COMPLETE, IN_PROGRESS, ERROR
8 | }
9 |
--------------------------------------------------------------------------------
/FrontEnd/src/app/services/upload-download.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { HttpClient, HttpRequest, HttpEvent, HttpResponse } from '@angular/common/http';
3 | import { of, Observable } from 'rxjs';
4 |
5 | @Injectable()
6 | export class UploadDownloadService {
7 | private baseApiUrl: string;
8 | private apiDownloadUrl: string;
9 | private apiUploadUrl: string;
10 | private apiFileUrl: string;
11 |
12 | constructor(private httpClient: HttpClient) {
13 | this.baseApiUrl = 'http://localhost:5001/api/';
14 | this.apiDownloadUrl = this.baseApiUrl + 'download';
15 | this.apiUploadUrl = this.baseApiUrl + 'upload';
16 | this.apiFileUrl = this.baseApiUrl + 'files';
17 | }
18 |
19 | public downloadFile(file: string): Observable> {
20 | return this.httpClient.request(new HttpRequest(
21 | 'GET',
22 | `${this.apiDownloadUrl}?file=${file}`,
23 | null,
24 | {
25 | reportProgress: true,
26 | responseType: 'blob'
27 | }));
28 | }
29 |
30 | public uploadFile(file: Blob): Observable> {
31 | const formData = new FormData();
32 | formData.append('file', file);
33 |
34 | return this.httpClient.request(new HttpRequest(
35 | 'POST',
36 | this.apiUploadUrl,
37 | formData,
38 | {
39 | reportProgress: true
40 | }));
41 | }
42 |
43 | public getFiles(): Observable {
44 | return this.httpClient.get(this.apiFileUrl);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/FrontEnd/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AARNOLD87/down-up-load-with-angular/60fdf9235c92c5dad01f36e9bb010e144cecc022/FrontEnd/src/assets/.gitkeep
--------------------------------------------------------------------------------
/FrontEnd/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/FrontEnd/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/FrontEnd/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/FrontEnd/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AARNOLD87/down-up-load-with-angular/60fdf9235c92c5dad01f36e9bb010e144cecc022/FrontEnd/src/favicon.ico
--------------------------------------------------------------------------------
/FrontEnd/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | FrontEnd
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/FrontEnd/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
--------------------------------------------------------------------------------
/FrontEnd/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/FrontEnd/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /**
38 | * If the application will be indexed by Google Search, the following is required.
39 | * Googlebot uses a renderer based on Chrome 41.
40 | * https://developers.google.com/search/docs/guides/rendering
41 | **/
42 | // import 'core-js/es6/array';
43 |
44 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
45 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
46 |
47 | /** IE10 and IE11 requires the following for the Reflect API. */
48 | // import 'core-js/es6/reflect';
49 |
50 | /**
51 | * Web Animations `@angular/platform-browser/animations`
52 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
53 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
54 | **/
55 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
56 |
57 | /**
58 | * By default, zone.js will patch all possible macroTask and DomEvents
59 | * user can disable parts of macroTask/DomEvents patch by setting following flags
60 | */
61 |
62 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
63 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
64 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
65 |
66 | /*
67 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
68 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
69 | */
70 | // (window as any).__Zone_enable_cross_context_check = true;
71 |
72 | /***************************************************************************************************
73 | * Zone JS is required by default for Angular itself.
74 | */
75 | import 'zone.js/dist/zone'; // Included with Angular CLI.
76 |
77 |
78 | /***************************************************************************************************
79 | * APPLICATION IMPORTS
80 | */
81 |
--------------------------------------------------------------------------------
/FrontEnd/src/styles.css:
--------------------------------------------------------------------------------
1 | .button {
2 | border: none;
3 | color: white;
4 | text-align: center;
5 | text-decoration: none;
6 | display: inline-block;
7 | font-size: 16px;
8 | cursor: pointer;
9 | margin: 30px;
10 | }
11 |
12 | .upload {
13 | background-color: #4CAF50;
14 | float: right;
15 | height: 40px;
16 | width: 200px;
17 | margin: 10px;
18 | }
19 |
20 | .download {
21 | background-color: rgb(184, 12, 12);
22 | width: 100px;
23 | height: 30px;
24 | }
25 |
26 | .button.disabled {
27 | opacity: 0.4;
28 | cursor: default;
29 | }
30 |
31 | .container {
32 | display: flex;
33 | }
34 |
35 | .container-upload {
36 | display: flex;
37 | align-items: flex-end;
38 | flex-direction: column;
39 | }
40 |
41 | ul {
42 | list-style-type: none;
43 | margin: 0;
44 | padding: 20px;
45 | width: 100%;
46 | }
47 |
48 | li {
49 | font: 200 20px/1.5 Helvetica, Verdana, sans-serif;
50 | border-bottom: 1px solid #ccc;
51 | }
52 |
53 | li:last-child {
54 | border: none;
55 | }
56 |
57 | li a {
58 | text-decoration: none;
59 | color: #000;
60 | display: block;
61 | }
62 |
63 | li a:hover {
64 | background: #f6f6f6;
65 | }
66 |
67 | label.error {
68 | font-size: 20pt;
69 | color: red;
70 | text-transform: uppercase;
71 | }
72 |
--------------------------------------------------------------------------------
/FrontEnd/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/FrontEnd/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/FrontEnd/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/FrontEnd/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FrontEnd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "target": "es5",
13 | "typeRoots": [
14 | "node_modules/@types"
15 | ],
16 | "lib": [
17 | "es2018",
18 | "dom"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FrontEnd/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs/Rx"
22 | ],
23 | "import-spacing": true,
24 | "indent": [
25 | true,
26 | "spaces"
27 | ],
28 | "interface-over-type-literal": true,
29 | "label-position": true,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-arg": true,
47 | "no-bitwise": true,
48 | "no-console": [
49 | true,
50 | "debug",
51 | "info",
52 | "time",
53 | "timeEnd",
54 | "trace"
55 | ],
56 | "no-construct": true,
57 | "no-debugger": true,
58 | "no-duplicate-super": true,
59 | "no-empty": false,
60 | "no-empty-interface": true,
61 | "no-eval": true,
62 | "no-inferrable-types": [
63 | true,
64 | "ignore-params"
65 | ],
66 | "no-misused-new": true,
67 | "no-non-null-assertion": true,
68 | "no-redundant-jsdoc": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "unified-signatures": true,
111 | "variable-name": false,
112 | "whitespace": [
113 | true,
114 | "check-branch",
115 | "check-decl",
116 | "check-operator",
117 | "check-separator",
118 | "check-type"
119 | ],
120 | "no-output-on-prefix": true,
121 | "use-input-property-decorator": true,
122 | "use-output-property-decorator": true,
123 | "use-host-property-decorator": true,
124 | "no-input-rename": true,
125 | "no-output-rename": true,
126 | "use-life-cycle-interface": true,
127 | "use-pipe-transform-interface": true,
128 | "component-class-suffix": true,
129 | "directive-class-suffix": true
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # down-up-load-with-angular
2 | Download and Upload with Angular
3 |
4 | To run project, you must execute:
5 | * the command dotnet run in Backend folder
6 | * the command ng serve in Frontend folder
7 |
--------------------------------------------------------------------------------