├── files └── data.txt ├── static ├── send.jpg ├── folder.png ├── recieve.png ├── err.css ├── post.css ├── script.js ├── recieve.css ├── nav.css ├── index.css ├── send.css └── send.js ├── recieve.html ├── post.html ├── index.html ├── send.html ├── README.md ├── app.py └── LICENSE /files/data.txt: -------------------------------------------------------------------------------- 1 | Data will be stored here.... -------------------------------------------------------------------------------- /static/send.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abhineetraj1/file-transfer-website/HEAD/static/send.jpg -------------------------------------------------------------------------------- /static/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abhineetraj1/file-transfer-website/HEAD/static/folder.png -------------------------------------------------------------------------------- /static/recieve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abhineetraj1/file-transfer-website/HEAD/static/recieve.png -------------------------------------------------------------------------------- /static/err.css: -------------------------------------------------------------------------------- 1 | #content{ 2 | text-align: center; 3 | padding: 1vh; 4 | width: 100%; 5 | margin-top: 3vh; 6 | color: #175dff; 7 | } -------------------------------------------------------------------------------- /static/post.css: -------------------------------------------------------------------------------- 1 | content{ 2 | text-align: center; 3 | } 4 | img{ 5 | margin-top: 3vh; 6 | width: 20%; 7 | position: relative; 8 | left: 40%; 9 | } 10 | p{ 11 | text-align: center; 12 | width: 100%; 13 | font-family: Bahnschrift; 14 | font-size: 20px; 15 | } 16 | @media screen and (max-width:680px) { 17 | img{ 18 | width:80%; 19 | left: 10%; 20 | } 21 | } -------------------------------------------------------------------------------- /static/script.js: -------------------------------------------------------------------------------- 1 | document.getElementById('toggle').onclick=function () { 2 | if (document.getElementById('toggle').innerHTML == "=") { 3 | document.getElementById('tgl').style.display = "block"; 4 | document.getElementById('toggle').innerHTML = "X"; 5 | document.getElementById("content").style.display="none"; 6 | } else { 7 | document.getElementById("content").style.display="inline"; 8 | document.getElementById('tgl').style.display = "none"; 9 | document.getElementById('toggle').innerHTML = "="; 10 | } 11 | } -------------------------------------------------------------------------------- /static/recieve.css: -------------------------------------------------------------------------------- 1 | #content{ 2 | text-align: center; 3 | width: 100%; 4 | margin-top: 3vh; 5 | } 6 | input{ 7 | text-align: left; 8 | font-family: Bahnschrift; 9 | font-size: 20px; 10 | border: solid; 11 | border-radius: 5px; 12 | } 13 | 14 | .frm-btn{ 15 | background: #175dff; 16 | font-family: Agency FB; 17 | color: white; 18 | padding: 1vh; 19 | margin: 1vh; 20 | border: solid; 21 | border-width: 0px; 22 | border-radius: 10px; 23 | font-size: 23px; 24 | padding-left: 3vh; 25 | padding-right: 3vh; 26 | } -------------------------------------------------------------------------------- /static/nav.css: -------------------------------------------------------------------------------- 1 | body{ 2 | padding: 0px; 3 | margin: 0px; 4 | } 5 | #nv{ 6 | font-family: Bahnschrift; 7 | box-shadow: 0px 0px 10px black; 8 | background: #175dff; 9 | color: white; 10 | font-size: 35px; 11 | padding-top: 3px; 12 | padding-bottom: 3px; 13 | text-align: center; 14 | width: 100%; 15 | } 16 | #toggle{ 17 | float: left; 18 | padding-left: 4px; 19 | } 20 | #tgl{ 21 | display: none; 22 | background: #175dff; 23 | width: 250px; 24 | color: white; 25 | font-size: 25px; 26 | padding: 2px; 27 | margin: 0px; 28 | height: 700px; 29 | } 30 | li{ 31 | margin: 3px; 32 | text-align: left; 33 | list-style-type: none; 34 | } 35 | footer{ 36 | font-family: Agency FB; 37 | position: absolute; 38 | bottom: 1px; 39 | font-size: 18px; 40 | } 41 | .li{ 42 | text-decoration: none; 43 | color: white; 44 | } -------------------------------------------------------------------------------- /recieve.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | File Snap 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 22 |
23 | 24 | 25 |
26 |
27 |

28 | 29 |
30 | 31 |
32 | 33 | 34 | 37 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | File Snap 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 21 |
22 | 23 | 24 |
25 | 26 |

---OR---

27 |

File ID: {{file_id}}

28 |

---OR---

29 |

Download link - link

30 |
31 | 32 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /static/index.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: white; 3 | } 4 | .as{ 5 | opacity: 0%; 6 | } 7 | #space{ 8 | color: white; 9 | height: 50vh; 10 | } 11 | #content{ 12 | width: 100%; 13 | position: fixed; 14 | margin: 0vh; 15 | height: 100vh; 16 | text-align: center; 17 | align-items: center; 18 | overflow-x: scroll; 19 | overflow: scroll; 20 | align-items: center; 21 | margin-top: 2vh; 22 | } 23 | h3{ 24 | width: 100%; 25 | text-align: center; 26 | margin-bottom: 2px; 27 | font-family: Bahnschrift; 28 | } 29 | .cnt{ 30 | width: 35%; 31 | margin: 7%; 32 | margin-top: 5px; 33 | float: left; 34 | border: solid; 35 | border-width: 3px; 36 | border-color: black; 37 | border-radius: 10px; 38 | background: #175dff; 39 | color: white; 40 | font-family: Bahnschrift; 41 | } 42 | .cnt-img{ 43 | width: 100%; 44 | margin: 0vh; 45 | border-radius: 10px 10px 0px 0px; 46 | 47 | } 48 | @media screen and (max-width: 550px) { 49 | .cnt{ 50 | width: 80%; 51 | margin: 10%; 52 | margin-top: 5px; 53 | } 54 | #content{ 55 | overflow: scroll; 56 | overflow-x: scroll; 57 | } 58 | } 59 | @media screen and (max-width: 500px) { 60 | .cnt{ 61 | width: 80%; 62 | margin: 10%; 63 | } 64 | #content{ 65 | overflow: scroll; 66 | overflow-x: scroll; 67 | } 68 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | File Share 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 22 |
23 |
24 | 25 |
26 | 27 |

Recieve file(s)

28 |
29 |
30 | 31 |
32 | 33 |

Send file(s)

34 |
35 |
36 | 37 |
38 | 39 |

Send file(s)

40 |
41 |
42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /send.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | File Snap 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 22 |
23 | 24 |
25 |
26 |

Drag and drop file(s) here

27 |
28 |

----OR----

29 |
30 | 31 |
32 |
33 | 34 |
35 | 36 | 37 |
38 | 39 |
40 |

Uploading file(s)

41 |
42 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /static/send.css: -------------------------------------------------------------------------------- 1 | #msg{ 2 | position: fixed; 3 | top: 40vh; 4 | left: 30%; 5 | box-shadow: 0px 0px 10px #ccc; 6 | border-radius: 8px; 7 | width: 40%; 8 | font-size: 28px; 9 | font-weight: bold; 10 | text-align: center; 11 | margin: 1vh; 12 | background: white; 13 | display: none; 14 | } 15 | body{ 16 | background: #ecf0f1; 17 | } 18 | #drg{ 19 | position: relative; 20 | left: 35%; 21 | height: 300px; 22 | /* background: #eae9e9; 23 | border: solid;*/ 24 | background: white; 25 | padding-top: 10px; 26 | box-shadow: 0px 0px 20px #85c1e9; 27 | width: 30%; 28 | margin-top: 3vh; 29 | border-radius: 10px; 30 | text-align: center; 31 | font-size: 20px; 32 | font-family: Bahnschrift; 33 | } 34 | input{ 35 | display: none; 36 | } 37 | #fle{ 38 | background: #175dff; 39 | color: white; 40 | font-size: 20px; 41 | padding: 2px; 42 | border-radius: 2px; 43 | border:solid; 44 | border-width: 0px; 45 | } 46 | #files{ 47 | display: none; 48 | } 49 | form{ 50 | width: 100%; 51 | text-align: center; 52 | display: none; 53 | } 54 | .frm-btn{ 55 | background: #175dff; 56 | font-family: Agency FB; 57 | color: white; 58 | padding: 1vh; 59 | margin: 1vh; 60 | border: solid; 61 | border-width: 0px; 62 | border-radius: 10px; 63 | font-size: 23px; 64 | padding-left: 3vh; 65 | padding-right: 3vh; 66 | } 67 | 68 | @media screen and (max-width:710px) { 69 | #drg{ 70 | width: 80%; 71 | left: 10%; 72 | } 73 | #msg{ 74 | width: 80%; 75 | left: 10%; 76 | } 77 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flask file transfer website 2 | 3 | TThis is s file transfer website, through which user can share files among different devices once at a time . 4 | 5 | ## Installation 6 | 1) First install python3.6 in your respective system 7 | 2) Download this source code 8 | ``` 9 | git clone https://github.com/abhineetraj1/file-transfer-website 10 | ``` 11 | 3) Install the required library 12 | ``` 13 | pip3 install flask 14 | ``` 15 | 16 | 17 | ## Execution 18 | 19 | 20 | 1) Open terminal in the respective folder (where you have downloaded the project) write the below code and hit enter 21 | 22 | ```flask run -h localhost``` 23 | 24 | 2) And then open web browser and navigate to localhost:5000 25 | 26 | ## Languages and tools used: 27 |

bootstrap css3 flask html5 javascript python

28 | 29 | 30 | 31 | ## Developer 32 | 33 | [@abhineetraj1](https://github.com/abhineetraj1) 34 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import qrcode 3 | import zipfile 4 | import datetime 5 | import os 6 | from flask import* 7 | from flask import render_template 8 | import qrcode 9 | 10 | app = Flask(__name__, static_folder="static",template_folder=os.getcwd()) 11 | 12 | url="http://localhost:5000/" 13 | 14 | #This function is created to delete first 4 files in directory in order to sustain server space 15 | def dtl(): 16 | try: 17 | k=os.listdir() 18 | for i in k: 19 | if k.index(i) != 4: 20 | if (".zip" in i): 21 | os.remove(i) 22 | else: 23 | break 24 | except Exception as sr: 25 | print(sr) 26 | 27 | def rdm(): 28 | return str(datetime.datetime.now()).replace(" ","").replace(":","").replace(".","").replace("-","") 29 | 30 | @app.route("/", methods=["GET"]) 31 | def a1(): 32 | dtl() 33 | return render_template("index.html") 34 | 35 | @app.route("/send", methods=["GET","POST"]) 36 | def a3(): 37 | if request.method == "POST": 38 | g= request.files.getlist("files[]") 39 | h=rdm() #random number is generated 40 | os.mkdir(f"files/{h}") #folder is created by name of that random number and files uploaded are stored in it 41 | qrcode.make(f"{url}/data/{h}/").save(f"files/{h}/qrcode.png") 42 | for i in g: 43 | i.save(f"files/{h}/{i.filename}") 44 | return render_template("post.html", file_id=h) 45 | else: 46 | return render_template("send.html") 47 | 48 | @app.route("/recieve", methods=["GET","POST"]) 49 | def a4(): 50 | if request.method == "GET": 51 | return render_template("recieve.html", err="none") 52 | else: 53 | #In this function if the directory name with that download ID exists then the folder is converted into zip and sent to client 54 | nm=request.form["id"] 55 | if nm in os.listdir("files"): 56 | zp = zipfile.ZipFile(f"{nm}.zip", 'w') 57 | for i in os.listdir(f"files/{nm}"): 58 | zp.write(f"files/{nm}/{i}") 59 | zp.close() 60 | shutil.rmtree(f"files/{nm}") 61 | return send_file(f"{nm}.zip") 62 | else: 63 | return render_template("recieve.html", err="No file(s) available") 64 | 65 | @app.route("/files//qrcode.png",methods=["GET"]) 66 | def a6(id): 67 | try: 68 | return send_file(f"files/{id}/qrcode.png") #function for generating QRcode for download link 69 | except: 70 | return "404" 71 | 72 | @app.route("/data/") 73 | def a7(nm): 74 | if nm in os.listdir("files"): 75 | zp = zipfile.ZipFile(f"{nm}.zip", 'w') 76 | for i in os.listdir(f"files/{nm}"): 77 | zp.write(f"files/{nm}/{i}") 78 | zp.close() 79 | shutil.rmtree(f"files/{nm}") 80 | return send_file(f"{nm}.zip") 81 | else: 82 | return render_template("recieve.html", err="No file(s) available") 83 | 84 | #Adding custom 404 error template 85 | @app.errorhandler(404) 86 | def a12(e): 87 | return render_template("err.html",err="404") 88 | 89 | #Error handling of internal server error 90 | @app.errorhandler(501) 91 | def a12(e): 92 | return render_template("err.html",err="501") 93 | 94 | if __name__ == '__main__': 95 | app.run() 96 | -------------------------------------------------------------------------------- /static/send.js: -------------------------------------------------------------------------------- 1 | document.getElementById('drg').ondragover = function (e) { 2 | e.preventDefault(); 3 | e.stopPropagation(); 4 | } 5 | document.getElementById('drg').ondragend = function (e) { 6 | e.preventDefault(); 7 | e.stopPropagation(); 8 | document.getElementById("drg").style.borderColor="#ccc"; 9 | } 10 | document.getElementById('drg').ondragenter = function (e) { 11 | e.preventDefault(); 12 | e.stopPropagation(); 13 | document.getElementById("drg").style.borderColor="#84a9ff"; 14 | } 15 | document.getElementById('drg').ondragexit = function (e) { 16 | e.preventDefault(); 17 | e.stopPropagation(); 18 | document.getElementById("drg").style.borderColor="#84a9ff"; 19 | } 20 | document.getElementById('drg').ondragstart = function (e) { 21 | e.preventDefault(); 22 | e.stopPropagation(); 23 | document.getElementById("drg").style.borderColor="#84a9ff"; 24 | } 25 | document.getElementById('drg').ondrag = function (e) { 26 | e.preventDefault(); 27 | e.stopPropagation(); 28 | } 29 | document.getElementById('drg').ondragleave = function (e) { 30 | e.preventDefault(); 31 | e.stopPropagation(); 32 | document.getElementById("drg").style.borderColor="#ccc"; 33 | } 34 | 35 | document.getElementById('drg').ondrop = function (e) { 36 | e.preventDefault(); 37 | e.stopPropagation(); 38 | document.getElementsByTagName('input')[1].files = e.dataTransfer.files; 39 | document.getElementById("drg").style.borderColor="#ccc"; 40 | setTimeout(function () { 41 | rt = get_len_b(); 42 | if (rt < 75) { 43 | document.getElementById("drg").innerHTML = (e.dataTransfer.files).length + " file(s) selected
Size: "+rt+" MB"; 44 | document.getElementById("frm").style.display="block"; 45 | } else { 46 | alert("Upload files with total size less than 75 MB"); 47 | } 48 | }, 1000); 49 | } 50 | document.getElementsByTagName('input')[0].oninput = function () { 51 | setTimeout(function () { 52 | rt=get_len(); 53 | if (rt < 75) { 54 | document.getElementsByTagName('input')[1].files = document.getElementsByTagName('input')[0].files; 55 | document.getElementById("drg").innerHTML = (document.getElementsByTagName('input')[0].files).length + " file(s) selected
Size: "+rt+" MB"; 56 | document.getElementById("frm").style.display="block"; 57 | } else { 58 | alert("Upload files with total size less than 75 MB"); 59 | } 60 | }, 1000); 61 | } 62 | function get_len() { 63 | var n=0; 64 | var i =0 ; 65 | while (i < document.getElementsByTagName("input")[0].files.length) { 66 | n = n + document.getElementsByTagName("input")[0].files[i].size; 67 | i++; 68 | } 69 | return Math.floor((n/1024)/1024); 70 | } 71 | function get_len_b() { 72 | var n=0; 73 | var i =0 ; 74 | while (i < document.getElementsByTagName("input")[1].files.length) { 75 | n = n + document.getElementsByTagName("input")[1].files[i].size; 76 | i++; 77 | } 78 | return Math.floor((n/1024)/1024); 79 | } 80 | document.getElementsByTagName("button")[0].onclick = function (e) { 81 | e.preventDefault(); 82 | e.stopPropagation(); 83 | document.getElementById("msg").style.display="block"; 84 | document.getElementsByTagName("form")[0].submit(); 85 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------