├── LICENSE ├── README.md ├── changelog.html ├── del.php ├── download.php ├── index.php ├── src ├── css │ ├── index.css │ ├── index.php │ ├── main.css │ ├── responsive.css │ ├── stat.css │ └── type.css ├── img │ ├── aud.png │ ├── audios.jpg │ ├── del.png │ ├── delete.png │ ├── home.png │ ├── images.jpg │ ├── index.php │ ├── oth.png │ ├── others.png │ ├── stat.png │ ├── update.gif │ ├── upload.ico │ ├── vid.png │ └── videos.png ├── index.php ├── script │ ├── index.php │ └── script.js └── set │ ├── disableDel.dat │ ├── disableDel.php │ ├── enableDel.php │ ├── index.php │ ├── memCap.dat │ └── setCap.php ├── stat.php ├── type.php ├── uploadMul.php └── uploads ├── aud ├── .notempty └── index.php ├── img ├── .notempty └── index.php ├── index.php ├── oth ├── .notempty └── index.php └── vid ├── .notempty └── index.php /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ronald P Mathews 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FileServer 2 | Once this code is hosted on a local server, users can access the index page inorder to upload files like photos, videos, music 3 | and other types of files into the server. This code could be useful for creating a NAS device using an old computer with enough 4 | storage. 5 | 6 | How to: 7 | 1) On a windows system, download and install XAMPP/WAMPP or on a Linux system install LAMPP and then copy these files into the 8 | HTDOCS folder. Also make sure that max upload file size have been set to a high enough value in your PHP config file inorder to 9 | allow uploading of large files. 10 | 2) Connect to the home network and set a static IP for you computer. 11 | 3) Once the above is done, ensure you have set in-bound and out-bound rules to enable. 12 | 4) Now if you type in the IP address of the now created server on the web browser on any of the devices connected to the LAN, 13 | you will be able to see the web interface and will be able to upload and manage files on the server. 14 | 15 | **On Linux based distributions, you might have to manually enable write permissions on the uploads folder for this application to work.** 16 | -------------------------------------------------------------------------------- /changelog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | File Server | Changelog 7 | 8 | 9 |
10 |
11 | 12 |
13 |
14 |
15 |
16 | Changelog: 17 |

18 | V2.0 19 | 24 |
25 | 26 | V1.2.3 27 | 31 |
32 | 33 | V1.2.2 34 | 41 |
42 | 43 | -------------------------------------------------------------------------------- /del.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /download.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FileServer 7 | 8 | 9 | 10 | 11 |
12 | FileServer 13 |
14 | 35 | 36 |
Server Status
37 |
38 |
39 |
40 |
41 |
42 |
Upload
43 | 44 |
45 | 59 |
60 |
61 | 62 | 63 |
64 |
65 |
Images
66 |
67 |
68 | 69 |
70 |
71 |
Videos
72 |
73 |
74 | 75 |
76 |
77 |
Audios
78 |
79 |
80 | 81 |
82 |
83 |
Others
84 |
85 |
86 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /src/css/index.css: -------------------------------------------------------------------------------- 1 | @media (min-width:960px){ 2 | body{ 3 | width:100%; 4 | font-family:'calibri light',calibri,arial; 5 | font-weight:100; 6 | margin:0px; 7 | background:#fff; 8 | overflow-x:hidden; 9 | } 10 | a{ 11 | color:#c8c8c8; 12 | text-decoration:none; 13 | outline:none; 14 | cursor:pointer; 15 | } 16 | input{ 17 | outline:none; 18 | } 19 | li{ 20 | list-style-type:none; 21 | } 22 | .topbar{ 23 | width:100%; 24 | position:fixed; 25 | background:#3f51b5; 26 | padding:18px; 27 | color:#fff; 28 | font-size:18px; 29 | } 30 | .shadow{ 31 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 32 | transition:0.2s; 33 | } 34 | .shadowDeep{ 35 | box-shadow:1px 2px 1px rgba(0,0,0,0.5); 36 | color:#fff; 37 | transition:0.2s; 38 | } 39 | .rightPanel{ 40 | float:right; 41 | margin-right:40px; 42 | font-size:16px; 43 | } 44 | .statIconHolder{ 45 | position:fixed; 46 | top:7%; 47 | border-radius: 100%; 48 | background:#c0e2ff; 49 | width:50px; 50 | height:50px; 51 | } 52 | .statImg{ 53 | height:50px; 54 | width:50px; 55 | cursor:pointer; 56 | } 57 | .main{ 58 | width:70%; 59 | margin:auto; 60 | padding-top:10%; 61 | } 62 | .uploadHolder{ 63 | width:100%; 64 | margin-bottom:30px; 65 | } 66 | #uploadLaunchButton{ 67 | padding:20px; 68 | padding-top:10px; 69 | padding-bottom:10px; 70 | border-radius:20px; 71 | background:#3f51b5; 72 | width:60px; 73 | font-size:17px; 74 | color:#fff; 75 | } 76 | #uploadLaunchButton:hover{ 77 | transition:0.3s; 78 | cursor:pointer; 79 | background:#243393; 80 | } 81 | .inContainer{ 82 | width:60%; 83 | height:auto; 84 | padding:0px; 85 | transition:0.1s; 86 | opacity:0; 87 | } 88 | .inContainer_later{ 89 | width:60%; 90 | transition:0.3s; 91 | padding:20px; 92 | color:#555; 93 | opacity:1; 94 | background:#fff; 95 | } 96 | .uploadSelector{ 97 | padding-left:6px; 98 | height:36px; 99 | width:70%; 100 | border:1px solid #e0e0e0; 101 | float:left; 102 | color:#444; 103 | cursor: pointer; 104 | } 105 | .uploadSelectorSideDiv{ 106 | float:left; 107 | background:#4285f4; 108 | height:29px; 109 | width:20%; 110 | text-align:center; 111 | color:#fff; 112 | cursor: pointer; 113 | font-family: arial; 114 | padding-top:11px; 115 | } 116 | .uploadBtn{ 117 | background:#e0e0e0; 118 | border:0px; 119 | height:40px; 120 | cursor: pointer; 121 | width:100px; 122 | color:#666; 123 | margin-top:20px; 124 | } 125 | #fileList{ 126 | font-size:15px; 127 | color:#444; 128 | font-family:arial; 129 | padding-top:10px; 130 | line-height:1.2; 131 | padding-left:2px; 132 | } 133 | .closeBtn{ 134 | height:16px; 135 | width:16px; 136 | background:#ea4335; 137 | float:right; 138 | border-radius: 100%; 139 | cursor:pointer; 140 | } 141 | .pieceHolder{ 142 | background:#fff; 143 | width:22%; 144 | height:200px; 145 | float:left; 146 | margin-right:3%; 147 | cursor:pointer; 148 | border-radius:2px; 149 | } 150 | .pieceHolder-image{ 151 | width:100%; 152 | height:150px; 153 | border-top-left-radius:2px; 154 | border-top-right-radius:2px; 155 | } 156 | .pieceHolder-text{ 157 | padding:10px; 158 | padding-top:12px; 159 | font-size:20px; 160 | color:#555; 161 | } 162 | 163 | } 164 | @media (min-width:600px) and (max-width:959px){ 165 | body{ 166 | width:100%; 167 | font-family:calibri light,calibri,arial; 168 | font-weight:100; 169 | margin:0px; 170 | background:#fff; 171 | overflow-x:hidden; 172 | } 173 | a{ 174 | color:#c8c8c8; 175 | text-decoration:none; 176 | outline:none; 177 | cursor:pointer; 178 | } 179 | input{ 180 | outline:none; 181 | } 182 | li{ 183 | list-style-type:none; 184 | } 185 | .topbar{ 186 | width:100%; 187 | position:fixed; 188 | background:#3f51b5; 189 | padding:17px; 190 | font-size:18px; 191 | } 192 | .shadow{ 193 | box-shadow:0 2px 2px rgba(0,0,0,0.3); 194 | color:#fff; 195 | } 196 | .shadowDeep{ 197 | box-shadow:0 4px 4px rgba(0,0,0,0.4); 198 | color:#fff; 199 | } 200 | .rightPanel{ 201 | float:right; 202 | margin-right:40px; 203 | font-size:16px; 204 | padding-top:3px; 205 | } 206 | .statIconHolder{ 207 | position:fixed; 208 | top:8%; 209 | border-radius: 100%; 210 | background:#c0e2ff; 211 | width:45px; 212 | height:45px; 213 | } 214 | .statImg{ 215 | height:45px; 216 | width:45px; 217 | cursor:pointer; 218 | } 219 | .main{ 220 | width:80%; 221 | margin:auto; 222 | padding-top:14%; 223 | } 224 | .uploadHolder{ 225 | width:100%; 226 | margin-bottom:30px; 227 | } 228 | #uploadLaunchButton{ 229 | padding:20px; 230 | padding-top:10px; 231 | padding-bottom:10px; 232 | border-radius:20px; 233 | background:#3f51b5; 234 | width:60px; 235 | font-size:17px; 236 | color:#fff; 237 | } 238 | #uploadLaunchButton:hover{ 239 | transition:0.3s; 240 | cursor:pointer; 241 | background:#243393; 242 | } 243 | .inContainer{ 244 | width:75%; 245 | height:auto; 246 | padding:0px; 247 | transition:0.1s; 248 | opacity:0; 249 | } 250 | .inContainer_later{ 251 | width:75%; 252 | transition:0.3s; 253 | padding:20px; 254 | color:#555; 255 | opacity:1; 256 | background:#fff; 257 | } 258 | .uploadSelector{ 259 | padding-left:6px; 260 | height:36px; 261 | width:70%; 262 | border:1px solid #e0e0e0; 263 | float:left; 264 | color:#444; 265 | cursor: pointer; 266 | } 267 | .uploadSelectorSideDiv{ 268 | float:left; 269 | background:#4285f4; 270 | height:29px; 271 | width:20%; 272 | text-align:center; 273 | color:#fff; 274 | cursor: pointer; 275 | font-family: arial; 276 | padding-top:11px; 277 | } 278 | .uploadBtn{ 279 | background:#e0e0e0; 280 | border:0px; 281 | height:40px; 282 | cursor: pointer; 283 | width:100px; 284 | color:#666; 285 | margin-top:20px; 286 | } 287 | #fileList{ 288 | font-size:15px; 289 | color:#444; 290 | font-family:arial; 291 | padding-top:10px; 292 | line-height:1.2; 293 | padding-left:2px; 294 | word-wrap:break-word; 295 | } 296 | .closeBtn{ 297 | height:16px; 298 | width:16px; 299 | background:#ea4335; 300 | float:right; 301 | border-radius: 100%; 302 | cursor:pointer; 303 | } 304 | .pieceHolder{ 305 | background:#fff; 306 | width:43%; 307 | height:200px; 308 | float:left; 309 | margin-right:7%; 310 | cursor:pointer; 311 | border-radius:2px; 312 | margin-bottom:50px; 313 | } 314 | .pieceHolder-image{ 315 | width:100%; 316 | height:150px; 317 | border-top-left-radius:2px; 318 | border-top-right-radius:2px; 319 | } 320 | .pieceHolder-text{ 321 | padding:10px; 322 | padding-top:12px; 323 | font-size:20px; 324 | color:#555; 325 | } 326 | 327 | } 328 | @media only screen and (max-width:599px){ 329 | body{ 330 | width:100%; 331 | font-family:calibri light,calibri,arial; 332 | font-weight:100; 333 | margin:0px; 334 | background:#fff; 335 | overflow-x:hidden; 336 | } 337 | a{ 338 | color:#c8c8c8; 339 | text-decoration:none; 340 | outline:none; 341 | cursor:pointer; 342 | } 343 | input{ 344 | outline:none; 345 | } 346 | li{ 347 | list-style-type:none; 348 | } 349 | .topbar{ 350 | width:100%; 351 | position:fixed; 352 | background:#3f51b5; 353 | padding:14px; 354 | font-size:18px; 355 | } 356 | .shadow{ 357 | box-shadow:0 2px 2px rgba(0,0,0,0.3); 358 | color:#fff; 359 | } 360 | .shadowDeep{ 361 | box-shadow:0 2px 2px rgba(0,0,0,0.4); 362 | color:#fff; 363 | } 364 | .rightPanel{ 365 | float:right; 366 | margin-right:30px; 367 | font-size:16px; 368 | padding-top:4px; 369 | } 370 | .statIconHolder{ 371 | position:fixed; 372 | top:7%; 373 | border-radius:100%; 374 | background:#c0e2ff; 375 | width:38px; 376 | height:38px; 377 | } 378 | .statImg{ 379 | height:38px; 380 | width:38px; 381 | cursor:pointer; 382 | float:right; 383 | } 384 | .main{ 385 | width:80%; 386 | margin:auto; 387 | padding-top:28%; 388 | } 389 | .uploadHolder{ 390 | width:100%; 391 | margin-bottom:30px; 392 | } 393 | #uploadLaunchButton{ 394 | padding:20px; 395 | padding-top:10px; 396 | padding-bottom:10px; 397 | border-radius:20px; 398 | background:#3f51b5; 399 | width:60px; 400 | font-size:17px; 401 | color:#fff; 402 | } 403 | #uploadLaunchButton:hover{ 404 | transition:0.3s; 405 | cursor:pointer; 406 | background:#243393; 407 | } 408 | .inContainer{ 409 | width:90%; 410 | height:auto; 411 | padding:0px; 412 | transition:0.1s; 413 | opacity:0; 414 | } 415 | .inContainer_later{ 416 | width:84%; 417 | transition:0.3s; 418 | padding:20px; 419 | color:#555; 420 | opacity:1; 421 | background:#fff; 422 | } 423 | .uploadSelector{ 424 | padding-left:4px; 425 | height:36px; 426 | width:60%; 427 | font-size:14px; 428 | border:1px solid #e0e0e0; 429 | float:left; 430 | color:#444; 431 | cursor: pointer; 432 | } 433 | .uploadSelectorSideDiv{ 434 | float:left; 435 | background:#4285f4; 436 | height:29px; 437 | width:30%; 438 | font-size:14px; 439 | text-align:center; 440 | color:#fff; 441 | cursor: pointer; 442 | font-family: arial; 443 | padding-top:11px; 444 | } 445 | .uploadBtn{ 446 | background:#e0e0e0; 447 | border:0px; 448 | height:40px; 449 | cursor: pointer; 450 | width:100px; 451 | color:#666; 452 | margin-top:20px; 453 | } 454 | #fileList{ 455 | font-size:15px; 456 | color:#444; 457 | font-family:arial; 458 | padding-top:10px; 459 | line-height:1.2; 460 | padding-left:2px; 461 | word-wrap:break-word; 462 | } 463 | .closeBtn{ 464 | height:16px; 465 | width:16px; 466 | background:#ea4335; 467 | float:right; 468 | border-radius: 100%; 469 | cursor:pointer; 470 | } 471 | .pieceHolder{ 472 | background:#fff; 473 | width:100%; 474 | height:200px; 475 | float:left; 476 | cursor:pointer; 477 | border-radius:2px; 478 | margin-bottom:50px; 479 | } 480 | .pieceHolder-image{ 481 | width:100%; 482 | height:150px; 483 | border-top-left-radius:2px; 484 | border-top-right-radius:2px; 485 | } 486 | .pieceHolder-text{ 487 | padding:10px; 488 | padding-top:12px; 489 | font-size:20px; 490 | color:#555; 491 | } -------------------------------------------------------------------------------- /src/css/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/css/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin: 0px; 3 | background: #F5F5F5; 4 | font-family: Tahoma; 5 | } 6 | a{ 7 | text-decoration: none; 8 | color: inherit; 9 | } 10 | .card{ 11 | box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); 12 | transition:all 0.3s cubic-bezier(0.25,0.8,0.25,1); 13 | } 14 | .card:hover{ 15 | box-shadow: 0 3px 7px rgba(0,0,0,0.25), 0 3px 3px rgba(0,0,0,0.22); 16 | } 17 | .paddLeft{ 18 | margin-left: 8px; 19 | } 20 | .aboutTxt{ 21 | font-size: 0.9em; 22 | margin-top: 12px; 23 | margin-left: 5px; 24 | position: absolute; 25 | float: left; 26 | } 27 | .infoTxt{ 28 | font-size: 0.9em; 29 | margin-top: 12px; 30 | margin-right: 5px; 31 | float: right; 32 | } 33 | .nameTxt{ 34 | margin-top: 8px; 35 | margin-left: 5px; 36 | } 37 | .fileName{ 38 | color: #000; 39 | width:100%; 40 | height:40px; 41 | background: #FFFDE7; 42 | border:1px solid #E0E0E0; 43 | } 44 | .topNav{ 45 | width:100%; 46 | height:44px; 47 | background: #FAFAFA; 48 | color: #000; 49 | box-shadow: 0 0 4px #8a8a8a; 50 | } 51 | .statLogo{ 52 | margin-top: 6px; 53 | float: right; 54 | margin-right: 8px; 55 | margin-left: 8px; 56 | } 57 | .mainBody{ 58 | width:95%; 59 | margin: auto; 60 | } 61 | .uploadBtn{ 62 | border: 0px; 63 | border-radius: 3px; 64 | background: #0277BD; 65 | padding: 3px; 66 | color: #FFF; 67 | width: 80px; 68 | } 69 | .uploadBtn:hover{ 70 | background: #01579B; 71 | } 72 | .typeBox{ 73 | width:280px; 74 | height: 280px; 75 | background: blue; 76 | margin-left: 30px; 77 | margin-top: 15px; 78 | border-radius: 3px; 79 | float:left; 80 | cursor: pointer; 81 | } 82 | .typeTxt{ 83 | color: #FFF; 84 | font-size: 1.9em; 85 | margin-left: 85px; 86 | margin-top: 115px; 87 | } 88 | .uploadBox{ 89 | padding: 15px; 90 | min-width:100px; 91 | height:5px; 92 | display: inline-block 93 | margin-bottom:5px; 94 | } 95 | .delBtn{ 96 | float:right; 97 | margin-top:-22px; 98 | margin-right:5px; 99 | } 100 | .textInp{ 101 | border: 0px; 102 | border-bottom: 2px solid #616161; 103 | height: 25px; 104 | padding:5px; 105 | } 106 | .textInp:focus{ 107 | outline: 0; 108 | border-bottom: 2px solid #212121; 109 | } 110 | -------------------------------------------------------------------------------- /src/css/responsive.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width:700px){ 2 | .mainBody{ 3 | width:100%; 4 | } 5 | .typeBox{ 6 | width:100%; 7 | height: 120px; 8 | background: red; 9 | margin: 0px; 10 | border-radius: 0px; 11 | } 12 | .typeTxt{ 13 | color: #FFF; 14 | font-family: Tahoma; 15 | font-size: 1.9em; 16 | margin:auto; 17 | margin-top: 42px; 18 | margin-left: 12px; 19 | } 20 | .uploadBox{ 21 | align-items: center; 22 | display: flex; 23 | justify-content: center; 24 | } 25 | .paddLeft{ 26 | margin-left: 12px; 27 | } 28 | } -------------------------------------------------------------------------------- /src/css/stat.css: -------------------------------------------------------------------------------- 1 | @media (min-width:960px){ 2 | body{ 3 | width:100%; 4 | font-family:'calibri light',calibri,arial; 5 | font-weight:100; 6 | margin:0px; 7 | background:#fff; 8 | overflow-x:hidden; 9 | } 10 | a{ 11 | color:#00a217; 12 | text-decoration:none; 13 | outline:none; 14 | cursor:pointer; 15 | } 16 | input{ 17 | outline:none; 18 | } 19 | .shadow{ 20 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 21 | transition:0.2s; 22 | } 23 | .rightPanel{ 24 | float:right; 25 | margin-right:40px; 26 | } 27 | .main{ 28 | width:70%; 29 | margin:auto; 30 | padding-top:7%; 31 | } 32 | .leftPart{ 33 | width:64%; 34 | float:left; 35 | } 36 | .matterHolder{ 37 | background:#fff; 38 | color:#555; 39 | font-size:18px; 40 | padding:20px; 41 | } 42 | .title-in{ 43 | font-size:24px; 44 | color:#4285f4; 45 | } 46 | .textInp{ 47 | width:70%; 48 | padding-left:6px; 49 | height:36px; 50 | border:0px; 51 | border-bottom:2px solid #4a92ff; 52 | float:left; 53 | color:#444; 54 | } 55 | .shadowLight{ 56 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 57 | } 58 | .setButton{ 59 | width:28%; 60 | border:0px; 61 | background:#bcbcbc; 62 | padding:9px; 63 | cursor:pointer; 64 | border-bottom:2px solid #4a92ff; 65 | } 66 | .deleteOption{ 67 | background:#e0e0e0; 68 | color:#555; 69 | font-size:18px; 70 | padding:20px; 71 | } 72 | .rightPart{ 73 | width:30%; 74 | margin-left:5%; 75 | float:left; 76 | } 77 | .inRightPart{ 78 | background:rgba(0,0,0,0.6); 79 | height:170px; 80 | color:#fff; 81 | } 82 | .simpleImg{ 83 | background:url('src/img/update.gif') center/cover; 84 | padding:0px; 85 | } 86 | .checkUpdate{ 87 | width:80%; 88 | padding:16px; 89 | border-radius:20px; 90 | } 91 | .whiteLink{ 92 | color:#fff; 93 | } 94 | .setRuleBtn{ 95 | padding:8px; 96 | border:0px; 97 | color:#fff; 98 | border-radius: 2px; 99 | cursor: pointer; 100 | } 101 | .disable{ 102 | background:#ea4335; 103 | } 104 | .enable{ 105 | background:#4285f4; 106 | } 107 | #uploadLaunchButton{ 108 | padding:20px; 109 | transition:0.3s; 110 | padding-top:10px; 111 | padding-bottom:10px; 112 | margin-bottom:30px; 113 | border-radius:20px; 114 | background:#4285f4; 115 | width:40px; 116 | font-size:17px; 117 | color:#fff; 118 | } 119 | #uploadLaunchButton:hover{ 120 | transition:0.3s; 121 | cursor:pointer; 122 | background:#999; 123 | } 124 | 125 | } 126 | @media (min-width:600px) and (max-width:959px){ 127 | body{ 128 | width:100%; 129 | font-family:'calibri light',calibri,arial; 130 | font-weight:100; 131 | margin:0px; 132 | background:#fff; 133 | overflow-x:hidden; 134 | } 135 | a{ 136 | color:#00a217; 137 | text-decoration:none; 138 | outline:none; 139 | cursor:pointer; 140 | } 141 | input{ 142 | outline:none; 143 | } 144 | .shadow{ 145 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 146 | transition:0.2s; 147 | } 148 | .rightPanel{ 149 | float:right; 150 | margin-right:20px; 151 | } 152 | .main{ 153 | width:90%; 154 | margin:auto; 155 | padding-top:7%; 156 | } 157 | .leftPart{ 158 | width:64%; 159 | float:left; 160 | } 161 | .matterHolder{ 162 | background:#fff; 163 | color:#555; 164 | font-size:16px; 165 | padding:16px; 166 | } 167 | .title-in{ 168 | font-size:24px; 169 | color:#4285f4; 170 | } 171 | .textInp{ 172 | width:69%; 173 | padding-left:6px; 174 | height:36px; 175 | border:0px; 176 | border-bottom:2px solid #4a92ff; 177 | float:left; 178 | color:#444; 179 | } 180 | .shadowLight{ 181 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 182 | } 183 | .setButton{ 184 | width:28%; 185 | border:0px; 186 | background:#bcbcbc; 187 | padding:9px; 188 | cursor:pointer; 189 | border-bottom:2px solid #4a92ff; 190 | } 191 | .deleteOption{ 192 | background:#e0e0e0; 193 | color:#555; 194 | font-size:16px; 195 | padding:16px; 196 | } 197 | .rightPart{ 198 | width:30%; 199 | margin-left:5%; 200 | float:left; 201 | } 202 | .inRightPart{ 203 | background:rgba(0,0,0,0.6); 204 | height:170px; 205 | color:#fff; 206 | } 207 | .simpleImg{ 208 | background:url('src/img/update.gif') center/cover; 209 | padding:0px; 210 | } 211 | .checkUpdate{ 212 | width:80%; 213 | padding:16px; 214 | border-radius:20px; 215 | } 216 | .whiteLink{ 217 | color:#fff; 218 | } 219 | .setRuleBtn{ 220 | padding:8px; 221 | border:0px; 222 | color:#fff; 223 | border-radius: 2px; 224 | cursor: pointer; 225 | } 226 | .disable{ 227 | background:#ea4335; 228 | } 229 | .enable{ 230 | background:#4285f4; 231 | } 232 | #uploadLaunchButton{ 233 | padding:20px; 234 | padding-top:10px; 235 | padding-bottom:10px; 236 | border-radius:20px; 237 | background:#3f51b5; 238 | width:60px; 239 | font-size:17px; 240 | color:#fff; 241 | } 242 | #uploadLaunchButton:hover{ 243 | transition:0.3s; 244 | cursor:pointer; 245 | background:#243393; 246 | } 247 | 248 | } 249 | @media only screen and (max-width:599px){ 250 | body{ 251 | width:100%; 252 | font-family:'calibri light',calibri,arial; 253 | font-weight:200; 254 | margin:0px; 255 | background:#fff; 256 | overflow-x:hidden; 257 | } 258 | a{ 259 | color:#00a217; 260 | text-decoration:none; 261 | outline:none; 262 | cursor:pointer; 263 | } 264 | input{ 265 | outline:none; 266 | } 267 | .shadow{ 268 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 269 | transition:0.2s; 270 | } 271 | .rightPanel{ 272 | float:right; 273 | margin-right:20px; 274 | } 275 | .main{ 276 | width:90%; 277 | margin:auto; 278 | padding-top:7%; 279 | } 280 | .leftPart{ 281 | width:100%; 282 | float:left; 283 | } 284 | .matterHolder{ 285 | background:#fff; 286 | color:#000; 287 | font-size:16px; 288 | padding:16px; 289 | } 290 | .title-in{ 291 | font-size:24px; 292 | color:#4285f4; 293 | } 294 | .textInp{ 295 | width:98%; 296 | padding-left:6px; 297 | height:36px; 298 | border:0px; 299 | border-bottom:2px solid #4a92ff; 300 | float:left; 301 | color:#444; 302 | } 303 | .shadowLight{ 304 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 305 | } 306 | .setButton{ 307 | width:28%; 308 | border:0px; 309 | background:#bcbcbc; 310 | margin-top:10px; 311 | padding:10px; 312 | cursor:pointer; 313 | } 314 | .deleteOption{ 315 | background:#e0e0e0; 316 | color:#555; 317 | font-size:16px; 318 | padding:16px; 319 | } 320 | .rightPart{ 321 | width:100%; 322 | margin-top:7%; 323 | margin-bottom:10%; 324 | float:left; 325 | clear:left; 326 | } 327 | .inRightPart{ 328 | background:rgba(0,0,0,0.6); 329 | height:170px; 330 | color:#fff; 331 | } 332 | .simpleImg{ 333 | background:url('src/img/update.gif') center/cover; 334 | padding:0px; 335 | } 336 | .checkUpdate{ 337 | width:80%; 338 | padding:16px; 339 | border-radius:20px; 340 | } 341 | .whiteLink{ 342 | color:#fff; 343 | } 344 | .setRuleBtn{ 345 | padding:8px; 346 | border:0px; 347 | color:#fff; 348 | border-radius: 2px; 349 | cursor: pointer; 350 | } 351 | .disable{ 352 | background:#ea4335; 353 | } 354 | .enable{ 355 | background:#4285f4; 356 | } -------------------------------------------------------------------------------- /src/css/type.css: -------------------------------------------------------------------------------- 1 | @media (min-width:960px){ 2 | body{ 3 | width:100%; 4 | font-family:'calibri light',calibri,arial; 5 | font-weight:100; 6 | margin:0px; 7 | background:#f1f1f1; 8 | overflow-x:hidden; 9 | } 10 | a{ 11 | color:#555; 12 | text-decoration:none; 13 | outline:none; 14 | cursor:pointer; 15 | } 16 | input{ 17 | outline:none; 18 | } 19 | li{ 20 | list-style-type:none; 21 | } 22 | .topbar{ 23 | width:100%; 24 | position:fixed; 25 | background:#3f51b5; 26 | padding:18px; 27 | color:#fff; 28 | font-size:18px; 29 | } 30 | .shadow{ 31 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 32 | transition:0.2s; 33 | } 34 | .shadowLight{ 35 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 36 | } 37 | .shadowDeep{ 38 | box-shadow:1px 2px 1px rgba(0,0,0,0.5); 39 | color:#fff; 40 | transition:0.2s; 41 | } 42 | .rightPanel{ 43 | float:right; 44 | margin-right:40px; 45 | font-size:16px; 46 | } 47 | .main{ 48 | width:70%; 49 | margin:auto; 50 | padding-top:10%; 51 | margin-bottom:100px; 52 | } 53 | .whiteLink{ 54 | color:#fff; 55 | } 56 | #uploadLaunchButton{ 57 | padding:20px; 58 | transition:0.3s; 59 | padding-top:10px; 60 | padding-bottom:10px; 61 | margin-bottom:30px; 62 | border-radius:20px; 63 | background:#4285f4; 64 | width:40px; 65 | font-size:17px; 66 | color:#fff; 67 | } 68 | #uploadLaunchButton:hover{ 69 | transition:0.3s; 70 | cursor:pointer; 71 | background:#999; 72 | } 73 | .fileName{ 74 | margin-bottom:10px; 75 | background:#fff; 76 | padding:14px; 77 | border-radius:3px; 78 | overflow-y:hidden; 79 | } 80 | .thumbnailHolder{ 81 | min-width:15%; 82 | border-right:1px solid #f1f1f1; 83 | margin-right:2%; 84 | float:left; 85 | } 86 | .thumbnail{ 87 | height:40px; 88 | float:left; 89 | } 90 | .nameTxt{ 91 | width:50%; 92 | float:left; 93 | padding-top:10px; 94 | } 95 | .delBtn{ 96 | width:30px; 97 | height:30px; 98 | float:right; 99 | padding-top:5px; 100 | } 101 | .lessPadding{ 102 | min-width:8%; 103 | } 104 | 105 | } 106 | @media (min-width:600px) and (max-width:959px){ 107 | body{ 108 | width:100%; 109 | font-family:'calibri light',calibri,arial; 110 | font-weight:100; 111 | margin:0px; 112 | background:#f1f1f1; 113 | overflow-x:hidden; 114 | } 115 | a{ 116 | color:#555; 117 | text-decoration:none; 118 | outline:none; 119 | cursor:pointer; 120 | } 121 | input{ 122 | outline:none; 123 | } 124 | li{ 125 | list-style-type:none; 126 | } 127 | .topbar{ 128 | width:100%; 129 | position:fixed; 130 | background:#3f51b5; 131 | padding:17px; 132 | color:#fff; 133 | font-size:18px; 134 | } 135 | .shadow{ 136 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 137 | transition:0.2s; 138 | } 139 | .shadowLight{ 140 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 141 | } 142 | .shadowDeep{ 143 | box-shadow:1px 2px 1px rgba(0,0,0,0.5); 144 | color:#fff; 145 | transition:0.2s; 146 | } 147 | .rightPanel{ 148 | float:right; 149 | margin-right:40px; 150 | font-size:14px; 151 | } 152 | .main{ 153 | width:80%; 154 | margin:auto; 155 | padding-top:14%; 156 | margin-bottom:100px; 157 | } 158 | .whiteLink{ 159 | color:#fff; 160 | } 161 | #uploadLaunchButton{ 162 | padding:20px; 163 | transition:0.3s; 164 | padding-top:10px; 165 | padding-bottom:10px; 166 | margin-bottom:30px; 167 | border-radius:20px; 168 | background:#4285f4; 169 | width:40px; 170 | font-size:17px; 171 | color:#fff; 172 | } 173 | #uploadLaunchButton:hover{ 174 | transition:0.3s; 175 | cursor:pointer; 176 | background:#999; 177 | } 178 | .fileName{ 179 | margin-bottom:10px; 180 | background:#fff; 181 | padding:14px; 182 | border-radius:3px; 183 | overflow-y:hidden; 184 | } 185 | .thumbnailHolder{ 186 | min-width:22%; 187 | border-right:1px solid #f1f1f1; 188 | margin-right:2%; 189 | float:left; 190 | } 191 | .thumbnail{ 192 | height:40px; 193 | float:left; 194 | } 195 | .nameTxt{ 196 | width:50%; 197 | float:left; 198 | padding-top:10px; 199 | font-size:3vmin; 200 | word-wrap:break-word; 201 | } 202 | .delBtn{ 203 | width:30px; 204 | height:30px; 205 | float:right; 206 | padding-top:5px; 207 | } 208 | .lessPadding{ 209 | min-width:10%; 210 | } 211 | 212 | } 213 | @media only screen and (max-width:599px){ 214 | body{ 215 | width:100%; 216 | font-family:'calibri light',calibri,arial; 217 | font-weight:100; 218 | margin:0px; 219 | background:#f1f1f1; 220 | overflow-x:hidden; 221 | } 222 | a{ 223 | color:#555; 224 | text-decoration:none; 225 | outline:none; 226 | cursor:pointer; 227 | } 228 | input{ 229 | outline:none; 230 | } 231 | li{ 232 | list-style-type:none; 233 | } 234 | .topbar{ 235 | width:100%; 236 | position:fixed; 237 | background:#3f51b5; 238 | padding:15px; 239 | color:#fff; 240 | font-size:18px; 241 | } 242 | .shadow{ 243 | box-shadow:0 2px 2px rgba(0,0,0,0.5); 244 | transition:0.2s; 245 | } 246 | .shadowLight{ 247 | box-shadow:0 1px 2px rgba(0,0,0,0.3); 248 | } 249 | .shadowDeep{ 250 | box-shadow:1px 2px 1px rgba(0,0,0,0.5); 251 | color:#fff; 252 | transition:0.2s; 253 | } 254 | .rightPanel{ 255 | float:right; 256 | margin-right:40px; 257 | font-size:15px; 258 | } 259 | .main{ 260 | width:90%; 261 | margin:auto; 262 | padding-top:20%; 263 | margin-bottom:100px; 264 | } 265 | .whiteLink{ 266 | color:#fff; 267 | } 268 | #uploadLaunchButton{ 269 | padding:20px; 270 | transition:0.3s; 271 | padding-top:10px; 272 | padding-bottom:10px; 273 | margin-bottom:30px; 274 | border-radius:20px; 275 | background:#4285f4; 276 | width:40px; 277 | font-size:17px; 278 | color:#fff; 279 | } 280 | #uploadLaunchButton:hover{ 281 | transition:0.3s; 282 | cursor:pointer; 283 | background:#999; 284 | } 285 | .fileName{ 286 | margin-bottom:10px; 287 | background:#fff; 288 | padding:10px; 289 | border-radius:3px; 290 | overflow-y:hidden; 291 | } 292 | .thumbnailHolder{ 293 | min-width:35%; 294 | border-right:1px solid #f1f1f1; 295 | margin-right:2%; 296 | float:left; 297 | } 298 | .thumbnail{ 299 | height:50px; 300 | float:left; 301 | } 302 | .nameTxt{ 303 | width:50%; 304 | float:left; 305 | padding-top:4px; 306 | font-size:4vmin; 307 | word-wrap:break-word; 308 | color:#222; 309 | } 310 | .delBtn{ 311 | width:26px; 312 | height:26px; 313 | float:right; 314 | padding-top:11px; 315 | } 316 | .lessPadding{ 317 | min-width:18%; 318 | } -------------------------------------------------------------------------------- /src/img/aud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/aud.png -------------------------------------------------------------------------------- /src/img/audios.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/audios.jpg -------------------------------------------------------------------------------- /src/img/del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/del.png -------------------------------------------------------------------------------- /src/img/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/delete.png -------------------------------------------------------------------------------- /src/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/home.png -------------------------------------------------------------------------------- /src/img/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/images.jpg -------------------------------------------------------------------------------- /src/img/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/img/oth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/oth.png -------------------------------------------------------------------------------- /src/img/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/others.png -------------------------------------------------------------------------------- /src/img/stat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/stat.png -------------------------------------------------------------------------------- /src/img/update.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/update.gif -------------------------------------------------------------------------------- /src/img/upload.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/upload.ico -------------------------------------------------------------------------------- /src/img/vid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/vid.png -------------------------------------------------------------------------------- /src/img/videos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/src/img/videos.png -------------------------------------------------------------------------------- /src/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/script/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/script/script.js: -------------------------------------------------------------------------------- 1 | 2 | function makeFileList() { 3 | var input = document.getElementById("upload"); 4 | var ul = document.getElementById("fileList"); 5 | while (ul.hasChildNodes()) { 6 | ul.removeChild(ul.firstChild); 7 | } 8 | var count=0; 9 | for (var i = 0; i < input.files.length; i++) { 10 | var li = document.createElement("li"); 11 | li.innerHTML = input.files[i].name; 12 | ul.appendChild(li); 13 | count+=1; 14 | } 15 | if(!ul.hasChildNodes()) { 16 | var li = document.createElement("li"); 17 | li.innerHTML = 'No Files Selected'; 18 | ul.appendChild(li); 19 | } 20 | document.uploadForm.inputBox.value=(count+" files selected"); 21 | count=0; 22 | } 23 | 24 | function showuploadBox(){ 25 | document.getElementById('inContainer').className="inContainer_later shadow"; 26 | document.getElementById('body').style.background="#e0e0e0"; 27 | document.getElementById('lcarte').style.display="block"; 28 | document.getElementById('uploadLaunchButton').style.opacity="0"; 29 | } 30 | 31 | function hideuploadBox(){ 32 | document.getElementById('inContainer').className="inContainer"; 33 | document.getElementById('body').style.background="#fff"; 34 | document.getElementById('lcarte').style.display="none"; 35 | document.getElementById('uploadLaunchButton').style.opacity="1"; 36 | } 37 | 38 | function clickOnBrowse(){ 39 | document.getElementById('upload').click(); 40 | } 41 | 42 | function switchChange(){ 43 | var loc=document.getElementById('headDivToggleValue'); 44 | if(loc.value=='1'){ 45 | document.getElementById('headDiv').className+=" head_later"; 46 | loc.value="0"; 47 | } 48 | else{ 49 | document.getElementById('headDiv').className="head shadowLight"; 50 | loc.value="1"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/set/disableDel.dat: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /src/set/disableDel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/set/enableDel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/set/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/set/memCap.dat: -------------------------------------------------------------------------------- 1 | 500 -------------------------------------------------------------------------------- /src/set/setCap.php: -------------------------------------------------------------------------------- 1 | =0){ 4 | unlink("memCap.dat"); 5 | $myfile = fopen("memCap.dat", "w") or die("Unable to open file!"); 6 | $txt = $cap; 7 | fwrite($myfile, $txt); 8 | fclose($myfile); 9 | header("Location: ../../stat.php"); 10 | } 11 | else{ 12 | echo "Please enter a number (Eg. 350)"; 13 | } 14 | ?> -------------------------------------------------------------------------------- /stat.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FileServer 7 | 8 | 9 | 10 | 11 | 12 |
13 |
Back
14 |
15 |
16 | FileServer

17 | "; 39 | //echo "
Server IP : $ip"; 40 | echo " 41 |
42 | Set a storage cap : 43 |

44 |
45 | 46 | 47 |
48 | "; 49 | 50 | $ip=$_SERVER['REMOTE_ADDR']; 51 | if($ip=="127.0.0.1" || $ip=="::1"){ 52 | $capFile = fopen("src/set/disableDel.dat", "r") or die("Unable to open file!"); 53 | $delStat = fread($capFile,filesize("src/set/disableDel.dat")); 54 | fclose($capFile); 55 | if($delStat==0){ 56 | echo " 57 |
58 |
59 |
60 | Disable file delete option :

61 | Disable 62 |

63 | 64 |
65 |
66 |
"; 67 | } 68 | elseif($delStat==1){ 69 | echo " 70 |
71 |
72 |
73 | Enable file delete option : 74 |

75 | Enable 76 |

77 | 78 |
79 |
80 |
81 | "; 82 | } 83 | } 84 | else{ 85 | echo " 86 |
87 | Your device IP : $ip

88 | "; 89 | } 90 | echo " 91 | View Changelogs 92 | "; 93 | ?> 94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | Software Version : V2.0
102 | Check for Updates on GitHub 103 |
105 |
106 | 107 | 108 | -------------------------------------------------------------------------------- /type.php: -------------------------------------------------------------------------------- 1 | 52 | 53 | 54 | 55 | 56 | '.$pTitle.' 57 | 58 | 59 | 60 | 61 | 62 |
63 | Back 64 |
'.$dirSize.'
65 |
66 |
67 | '; 68 | if($fileCount>4){ 69 | for($i=2;$i<$fileCount;$i++){ 70 | if($files[$i]=="index.php") 71 | continue; 72 | $fileLoc = $dir.$files[$i]; 73 | if($files[$i]!=".notempty"){ 74 | if($typ==4){ 75 | echo ""; 76 | } 77 | else{ 78 | echo ""; 79 | } 80 | echo" 81 | 127 | "; 128 | } 129 | } 130 | } 131 | else{ 132 | //The folder is empty 133 | echo "
Folder is empty
"; 134 | } 135 | echo " 136 |
137 | 138 | 139 | 140 | "; 141 | ?> 142 | -------------------------------------------------------------------------------- /uploadMul.php: -------------------------------------------------------------------------------- 1 | 0){ 24 | for($i=0; $i0) 81 | header('Location: index.php?e=1'); 82 | else 83 | header('Location: index.php'); 84 | //header('Location: index.php'); 85 | } 86 | //Storage cap exceeded. Error message is shown 87 | else{ 88 | echo "Storage limit exceeded! Delete some files or increase the storage limit from dashboard."; 89 | } 90 | } 91 | ?> 92 | -------------------------------------------------------------------------------- /uploads/aud/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/uploads/aud/.notempty -------------------------------------------------------------------------------- /uploads/aud/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /uploads/img/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/uploads/img/.notempty -------------------------------------------------------------------------------- /uploads/img/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /uploads/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /uploads/oth/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/uploads/oth/.notempty -------------------------------------------------------------------------------- /uploads/oth/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /uploads/vid/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RonaldPM/FileServer/490668b0336249b65bec2be599306ba65e66e565/uploads/vid/.notempty -------------------------------------------------------------------------------- /uploads/vid/index.php: -------------------------------------------------------------------------------- 1 | 4 | --------------------------------------------------------------------------------