Skip to content

Song2017/FileDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileDownloader

Service oriented .NET Core Web API app

Description

This Web API web app based on .NET Core 2.2 Framework, aim to download xml, word and zip file.

Functions

  • Authentication: Json web token
  • Download Files: xml, word, zip
  • Throttle: depends on cache, fault tolerant
  • Distribute cahce: fault tolerant
  • Access DB data: Oracle pooling
  • swagger api: /swagger

Application Perspective

  1. Browser user authenticate with credentials and get an jwt,
  2. When Server side receives the request with token,
  • it queries file name from redis cache, if exists, return filename
  • if not, query data from Oracle DB and generate file in server, then return file name.

Technical Structure

Authntication

axios -- body: credenticals-- > authenticate server authenticate server -- token --> axios

Download File

axios -- authentication: token -- > API server API server -- Throttle middleware with cache --> -- Validate credenticals with DB --> -- Check file name exists in cache(if exists, response filename) --> -- Generate physical files in server with DB --> -- Response with file name --> axios axios -- javascript download file via url --> file

API Parameters

  1. Authentication
  • Use Jwt to authenticate user.
  • Throttle middle defense DDos attack.
POST /vkshare/authenticate HTTP/1.1
Content-Type: application/json;charset=UTF-8
{ 
   "UserName":"UserName",
   "Password":"Password",
   "TenantCode":"TenantCode"
}
  1. Download File
GET /vkshare/repair?Owner=test&Plant=test&TagNumber=rvtag&ValveType=RV&FileType=XML&SerialNumber= HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJWS0NBcHAiOiJCMWMreVNKcjNmM0hkUWhadmdiZmpKVE5wQnhkajF5ZGdvazlkY3pqNkVBPSIsIm5iZiI6MTU3MTI5OTM3OSwiZXhwIjoxNTcxMzAyOTc5LCJpYXQiOjE1NzEyOTkzNzl9.pl6hq_DmBSJ7QM_CwNgTU_9CqaxB71OKdMxwkB4_1gI

Note

Definitions and Abbreviations

Operating Environment

Windows OS + IIS + Oracle 12c

Assumptions and Dependencies

Chrome 76 + .Net Core 2.x

About

Service oriented .NET Core Web API app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published