diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | arrow.svg | 62 | ||||
-rw-r--r-- | arrows.js | 37 | ||||
-rw-r--r-- | bottom.svg | 62 | ||||
-rw-r--r-- | file_type_recogniser.php | 84 | ||||
-rw-r--r-- | index.html | 55 | ||||
-rw-r--r-- | sql/fileshare.sql | 49 | ||||
-rw-r--r-- | style.css | 181 | ||||
-rw-r--r-- | svg/icons/.dat.svg | 67 | ||||
-rw-r--r-- | svg/icons/.txt.svg | 65 | ||||
-rw-r--r-- | upload.php | 23 |
11 files changed, 686 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..533e888 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +screen diff --git a/arrow.svg b/arrow.svg new file mode 100644 index 0000000..1f65efe --- /dev/null +++ b/arrow.svg @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="128.46289" + height="620.49023" + viewBox="0 0 33.989141 164.17137" + version="1.1" + id="svg8" + sodipodi:docname="arrow.svg" + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1033" + inkscape:window-height="1050" + id="namedview58" + showgrid="false" + inkscape:zoom="1.3908357" + inkscape:cx="62.793461" + inkscape:cy="309.88562" + inkscape:window-x="16" + inkscape:window-y="25" + inkscape:window-maximized="0" + inkscape:current-layer="svg8" + inkscape:document-rotation="0" /> + <defs + id="defs2" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + transform="translate(-9.8831177,-26.865543)" + style="fill:#231179;fill-opacity:1"> + <path + id="rect12" + style="fill:#231179;fill-rule:evenodd;stroke-width:0.860931;fill-opacity:1" + d="M 101.58398,101.53906 37.353516,254.44747 75.386719,234.3418 v 487.68554 l 26.197261,-20.0516 26.19922,20.05356 V 234.3418 l 38.03321,20.10567 z" + transform="scale(0.26458333)" /> + </g> +</svg> diff --git a/arrows.js b/arrows.js new file mode 100644 index 0000000..4584aea --- /dev/null +++ b/arrows.js @@ -0,0 +1,37 @@ + +arrows = []; + +const minSpeed = 3; +const maxSpeed = 8; +const delay = 3000; +const lifetime = 20000; + +function make_arrow() { + const svg = document.getElementById("protoarrow").cloneNode(); + svg.style.left = Math.random() * 100 + '%'; + svg.style.display = 'block'; + document.getElementById('arrows').append(svg); + const ob = { + y: -800, + svg: svg, + speed: Math.random() * (maxSpeed - minSpeed) + minSpeed + }; + arrows.push(ob); + setTimeout(make_arrow, delay); + setTimeout(() => { + svg.remove(); + arrows.remove(ob); + }, lifetime); +} + +function update() { + for (const arrow of arrows) { + arrow.y += arrow.speed; + arrow.svg.style.bottom = arrow.y + 'px'; + } + + window.requestAnimationFrame(update); +} + +make_arrow(); +update(); diff --git a/bottom.svg b/bottom.svg new file mode 100644 index 0000000..772081e --- /dev/null +++ b/bottom.svg @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="1920" + height="1080" + viewBox="0 0 508 285.75" + version="1.1" + id="svg8" + sodipodi:docname="bottom.svg" + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1080" + id="namedview879" + showgrid="false" + inkscape:zoom="0.69739583" + inkscape:cx="698.31217" + inkscape:cy="540" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="layer1" /> + <defs + id="defs2" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1"> + <path + id="path67" + style="fill:#231179;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" + d="m 497.63807,220.97629 c -0.21383,0.005 -0.42079,0.0476 -0.61497,0.1447 -0.30964,0.15483 -0.44627,0.54229 -0.73432,0.73432 -0.87445,0.58298 -2.75508,0.63823 -3.71295,1.11569 -0.31176,0.15541 -0.43654,0.56558 -0.73896,0.73846 -1.20155,0.6869 -2.47454,1.23984 -3.71245,1.8588 -3.67231,1.83615 -5.9033,1.81488 -9.942,1.81488 -3.68084,0 -0.648,2.88761 -3.12749,5.36711 -2.18828,2.1883 -4.03066,1.78386 -6.69104,2.60243 -3.72497,1.1462 0.8976,0.48362 -3.2489,1.11518 -1.41195,0.21506 -3.33134,-0.5085 -4.6142,0.35398 -0.80788,0.54319 -1.43637,1.32595 -2.2443,1.86913 -1.32096,0.88812 -1.62378,-0.004 -2.72386,1.46245 -0.49406,0.65874 -0.78574,1.4507 -1.0976,2.21278 -0.023,0.0565 0.0278,0.6494 0,0.6718 -0.7134,0.57388 -2.97177,2.19666 -3.95481,2.48925 -1.4324,0.42634 -3.91221,0.20244 -5.4348,0.37207 -1.82431,0.20323 -3.10261,0.97046 -4.82349,1.48673 -1.50932,0.45279 -3.41048,0.36304 -4.78835,0.92139 -0.51356,0.20812 -0.9615,0.56787 -1.48725,0.74311 -0.0245,0.008 -2.70674,0.24511 -2.87269,0.37207 -1.17967,0.90248 -2.13,2.36269 -3.58685,2.85254 -2.67652,0.89994 -5.15641,-0.79198 -7.26725,-1.85415 -0.30681,-0.15438 -0.41148,-0.59684 -0.72864,-0.72864 -0.58393,-0.24268 -1.09873,0.24949 -1.58906,0.37207 -0.24043,0.0601 -0.52194,-0.11083 -0.74361,0 -0.31348,0.15674 -0.45149,0.5487 -0.74311,0.74311 -1.4795,0.98633 -2.2283,1.44756 -2.59519,1.64589 -0.28194,0.2849 -0.84371,0.80561 -1.86603,1.70016 -0.67249,0.5884 -1.59388,0.85958 -2.23036,1.48673 -0.25789,0.2541 -0.24715,0.81774 -0.64339,0.99374 -0.5648,0.25087 -1.23613,0 -1.85414,0 -4.73573,0 -7.96452,-1.07723 -11.62876,1.85415 -2.64559,2.1165 -3.55491,5.00358 -5.18416,7.78608 -1.01481,1.73315 -3.39051,2.5346 -4.6762,3.94085 -0.25992,0.28606 0.0373,0.88714 -0.26252,1.13274 -2.72698,2.23357 -3.12936,2.20431 -4.84571,5.20124 -0.63365,1.10639 -0.16473,1.62327 -0.74361,2.97398 -0.4617,1.07729 -1.68582,1.73516 -2.21279,2.95589 -0.15565,0.36056 0.1827,0.87171 0,1.23713 -0.15674,0.31348 -0.61343,0.41823 -0.74364,0.74363 -0.13806,0.34515 0.0729,0.75065 0,1.11517 -0.35898,1.79489 -2.9442,4.69887 -4.82811,5.07566 -0.76573,0.15314 -5.75429,0.27416 -6.59442,0 -0.7656,-0.24984 -1.38044,-1.27974 -2.16059,-1.08003 -1.67865,0.42973 -3.77251,-0.15703 -5.34128,0.37155 -3.36248,1.13293 -5.64478,1.12189 -9.18964,1.12189 -0.99578,0 -2.63472,0.25916 -3.67469,0 -2.09669,-0.52243 -2.29434,-1.87255 -3.70263,-2.2257 -1.77134,-0.44418 -5.93903,0.26012 -7.44347,0.75138 -0.23342,0.0762 -0.41355,0.33979 -0.65887,0.32969 -0.79372,-0.0326 -1.12755,-1.18561 -1.86243,-1.48725 -0.81142,-0.33305 -1.67338,-0.52834 -2.52179,-0.75085 -1.61312,-0.42308 -2.45994,0.27724 -3.62614,1.05471 -0.6471,0.4314 -1.85804,-0.24986 -2.61689,0 -1.10773,0.36475 -2.40581,1.0697 -3.6091,1.0697 -0.33743,0 -0.39614,-0.60902 -0.71623,-0.71572 -1.69796,-0.56599 -2.40102,-0.74299 -4.01111,-1.78076 -0.30218,-0.19476 -5.05704,-0.49093 -6.29626,-1.11053 -1.46111,-0.73053 -0.001,-0.73679 -1.47278,-1.10588 -0.78605,-0.19712 -0.7843,0.33089 -1.48725,-0.37207 -1.71204,-1.71203 -2.5177,-2.76083 -4.95422,-3.92844 -1.48222,-0.71028 -4.07511,0.3212 -5.65496,-0.50746 -0.83762,-0.43935 -0.81479,-1.50876 -1.83036,-1.84434 -1.3996,-0.46243 -3.33833,0.23042 -4.80439,0 -0.26265,-0.0413 -0.47881,-0.2312 -0.71829,-0.34674 -0.0864,-0.0864 -0.14126,-0.2276 -0.25942,-0.2589 -2.29989,-0.60974 -4.98044,0.20989 -7.30446,-0.36742 -1.94929,-0.48422 -4.37084,0.63303 -6.26991,0 -0.81349,-0.27116 -1.47921,-1.00355 -2.17763,-1.46916 -1.66113,-1.10743 -3.94404,-2.43903 -5.88129,-2.94039 -2.71332,-0.70218 -6.00825,0.88449 -8.62894,-0.3669 -1.49247,-0.71266 -2.58787,-1.85912 -3.96565,-2.89182 -0.40918,-0.3067 -2.44325,-0.56894 -2.72128,-0.66094 -0.37565,-0.12431 -0.62032,-0.52561 -0.99839,-0.64234 -2.68235,-0.82824 -5.37604,1.01928 -7.96489,0.37207 -0.50788,-0.12697 -0.6247,-0.91598 -1.11052,-1.11104 -0.65105,-0.26141 -3.19028,-0.27466 -4.01423,0 -0.95413,0.31804 -1.67417,1.15422 -2.61948,1.49758 -0.72075,0.26179 -1.51901,0.22052 -2.26911,0.37982 -0.37422,0.0795 -0.67233,0.5779 -1.04231,0.4806 -0.24094,-0.0634 -0.47245,-0.66545 -0.71365,-0.71366 -1.61484,-0.32297 -1.69751,-0.19289 -3.33572,-0.73897 -1.73767,-0.57924 -4.1251,0.26068 -5.9433,0 -1.97976,-0.28384 -4.28466,-0.77562 -6.30504,-0.37155 -0.2717,0.0543 -0.4687,0.33715 -0.74363,0.37155 -0.8737,0.10921 -10.32235,-0.28155 -10.49031,-0.37155 -3.92899,-2.10471 -4.2422,-2.21796 -8.78965,-2.21796 -0.20941,0 -4.62015,0.46026 -4.79764,0.37156 -0.3996,-0.19981 -0.6856,-0.62037 -1.11518,-0.74311 -3.03456,-0.86701 -0.082,1.05631 -2.6019,-0.74362 -1.01452,-0.72465 -2.76881,-3.02727 -3.71761,-3.34553 -1.31732,-0.44188 -2.54185,0.37155 -3.69383,0.37155 -2.15526,0 -4.13542,-0.0666 -6.2699,-0.37155 -1.66509,-0.23787 -3.43728,0.26789 -5.09788,0 -1.98284,-0.3199 -4.136,-0.53441 -6.20841,-0.72606 -1.0062,-0.0931 -2.10829,0.41124 -3.03134,0 -0.32363,-0.14419 0.66285,-0.2512 0.2682,-0.50023 -0.21136,-0.13337 -0.52011,0.0985 -0.74982,0 -0.78632,-0.33698 -1.47729,-0.89788 -2.29547,-1.14773 -1.20609,-0.36831 -3.56557,0 -4.82037,0 -2.02487,0 -6.61095,0.55532 -8.13698,0 -0.21342,-0.0777 -2.86775,-2.04728 -3.00291,-1.90996 -2.28069,2.31718 -3.90435,6.13176 -7.23419,7.244 -1.40999,0.47097 -3.44576,-0.14158 -4.82296,-0.37207 -1.68505,-0.28202 -7.35983,-0.37619 -8.86457,0 -0.49565,0.12391 -1.04864,0.10922 -1.48673,0.37207 -0.70454,0.42273 -1.72072,2.05402 -2.60243,2.23036 -1.7418,0.34837 -3.64959,-0.22411 -5.41621,0 -1.67931,0.21305 -3.53647,1.11131 -5.25859,0.76687 -0.16445,-0.0329 -0.18995,-0.32893 -0.35553,-0.35553 -1.14451,-0.18388 -4.021125,-0.38821 -5.185728,0 -0.423844,0.14128 -0.70036,0.57718 -1.115176,0.74311 -1.451475,0.58059 -3.654618,0.62796 -5.204333,0.37207 -1.126384,-0.18598 -1.04458,-0.90503 -1.831414,-1.10174 -0.360638,-0.0902 -0.770028,0.13806 -1.115177,0 -0.325405,-0.13016 -0.411136,-0.6328 -0.743624,-0.74363 -1.240928,-0.41363 -3.213346,-0.17582 -4.460708,-0.37155 -1.809176,-0.2839 -3.827521,-1.04683 -5.587773,-1.47381 -1.64842,-0.39985 -1.741114,-1.86662 -4.748032,-2.16731 -5.409454,-0.54095 -11.412834,-0.011 -16.695105,0.74362 -1.681041,0.24015 -3.773774,1.91921 -5.947955,2.23036 -1.476822,0.21135 -3.366834,-0.47174 -4.75165,0 -0.96639,0.32924 -2.259102,0.63967 -3.331577,0.37155 -0.627976,-0.157 -1.788642,-1.05167 -2.480988,-0.70332 -0.742301,0.37349 -1.904894,2.61144 -2.8298,2.47375 -0.312037,-0.0464 -0.669301,-1.04087 -0.721921,-1.09347 -0.630166,-0.63017 -1.83686,-0.65414 -2.602423,-1.11518 -0.515459,-0.31042 -0.871453,-0.90037 -1.44539,-1.08107 -0.818266,-0.25763 -6.200195,-0.17458 -6.881752,0 -1.394754,0.35725 -2.689666,0.83539 -4.088639,1.11518 -1.923868,0.38478 -4.641963,-0.89646 -6.216675,-0.37155 -1.645038,0.54834 -2.970826,0.7431 -4.8322629,0.7431 -0.963813,0 -1.670468,-0.9414 -2.530078,-0.71933 -2.5866389,0.66822 -6.29791725,2.58785 -8.5498656,4.08916 -0.2916132,0.1944 -0.4187418,0.61215 -0.7436238,0.74362 -0.6323156,0.25588 -1.3415011,0.24764 -2.0122802,0.37155 l -1.0867554,9.08058 v 10e-4 c -0.3089068,1.2756 -0.2408467,2.75466 -0.7493081,3.8902 -0.1676488,0.3744 0.1500007,1.00218 0,1.37718 -0.1659266,0.41482 -0.6023428,0.69133 -0.7436239,1.11517 -0.5064281,1.51928 -0.2110941,3.23623 -0.7431072,4.83227 -0.294686,0.88406 -1.2685035,1.39606 -1.4696778,2.19573 -0.5917971,2.35242 0.6814589,4.4124 1.1105266,6.55774 0.072903,0.36451 -0.1175531,0.76252 0,1.11517 0.015277,0.0458 0.035384,0.0895 0.056844,0.1323 l -1.2014771,10.04073 v 5.3e-4 c -0.2488039,1.1631 -0.3110667,2.52356 -0.6004796,3.39047 -0.1427866,0.4277 -0.716228,0.67591 -0.750342,1.12551 -0.08441,1.11255 0.275246,2.21454 0.412894,3.32177 0,1.24931 -0.428128,3.31906 0,4.46071 0.253695,0.67654 0.8468392,1.18796 1.1151778,1.85881 0.9613397,2.40334 0.076328,4.32181 1.8691365,6.71224 0.7696115,1.02613 1.0081654,0.75964 2.2303549,1.48725 0.528941,0.3149 0.8693407,1.04037 1.3761434,1.37562 0.3255679,0.2154 0.9790305,-0.54211 1.1105264,0.37208 0.9503502,0.71276 1.82411345,2.06523 3.00343416,2.40761 2.25410904,0.65442 9.40822744,-0.79762 10.92078084,0 2.515322,1.3264 5.499643,0.96451 8.339025,1.18287 2.726979,0.20971 5.771924,0.75726 8.489923,0.90691 6.384589,0.35153 12.872973,0 19.277374,0 h 9.828858 c 1.519434,0 3.359555,-0.27707 4.857584,0 7.18616,1.32913 -0.753759,0.84958 9.474358,0.84958 H 100.3047 c 4.60658,0 9.3189,-0.2445 13.92886,0 5.25967,0.27895 3.19361,0.37483 7.92665,0.8578 4.14056,0.42249 8.31525,0.50512 12.44317,1.03717 12.48686,1.60938 1.58295,0.0618 5.04569,1.20613 0.84924,0.28062 3.93607,0.32168 4.3279,0.39119 2.84707,0.5053 5.62899,1.35948 8.4894,1.78284 3.21201,0.47543 6.70281,-0.22252 9.94151,0 9.709,0.66704 19.51619,0.39169 29.26798,0.39169 h 74.88431 11.89541 c 2.40265,0 4.82359,0.29665 7.20783,0 1.8986,-0.23625 3.70149,-0.90586 5.62911,-1.12242 2.99197,-0.33618 6.64258,0 9.53379,0 h 17.19172 c 3.31044,0 6.96111,0.27435 10.27999,0 8.33223,-0.68879 16.44521,-2.98336 24.90132,-3.37756 5.22139,-0.24339 10.29996,0.20449 15.47656,0.37208 2.47229,0.08 4.9608,-0.25948 7.42074,0 24.66634,2.60194 -1.93971,1.60478 19.83394,2.38485 9.03808,0.3238 18.16258,0 27.20816,0 3.78613,0 7.99158,-0.29337 11.80547,0 2.58548,0.19889 4.85296,1.92849 7.47241,2.23761 1.1099,0.13096 2.24526,-0.14973 3.35278,0 0.78478,0.10609 1.4696,0.63595 2.25205,0.75808 3.76206,0.58724 10.32304,0 14.27872,0 1.92955,0 7.04114,0.57637 8.92193,0 1.19007,-0.3647 2.2569,-1.0545 3.41789,-1.50326 5.53447,-2.13929 10.75036,-3.68609 16.68116,-4.45659 4.14311,-0.53826 9.81726,-0.63002 14.15158,-1.69653 0.6863,-0.16888 1.22132,-0.71218 1.82417,-1.08106 1.8156,-1.11096 3.56746,-2.32365 5.37229,-3.45199 0.59264,-0.3705 4.51053,-2.1979 5.38313,-3.56153 0.86445,-1.35094 -1.28357,-9.90698 -1.49397,-11.57658 -0.27924,-2.21586 -0.57947,-5.29765 -0.74311,-7.42487 -0.12483,-1.6228 0.25445,-1.62243 -0.3674,-3.33209 -0.34877,-0.95874 -1.29609,-2.20644 -1.48675,-3.34553 -0.25831,-1.54326 0.15529,-3.26313 0,-4.81417 -0.15271,-1.52508 -0.83944,-2.95301 -1.11516,-4.46071 -0.5093,-2.78479 2.7786,-2.44943 3.00188,-7.10345 0.0764,-1.59162 0.26138,-7.10688 0,-9.19478 -0.10885,-0.86941 -0.42907,-1.72757 -0.37208,-2.60191 0.26971,-4.14004 2.79027,-7.29198 2.44274,-11.48767 -0.1468,-1.77283 -1.30636,-2.67562 -1.48672,-4.52169 -0.42971,-4.39852 -0.44133,-8.46347 -0.44133,-12.84418 v -12.8726 c 0,-1.37247 0.18214,-2.75724 0,-4.11758 -0.074,-0.55273 -0.57327,-0.96652 -0.75136,-1.495 -0.29189,-0.86633 0.094,-1.9343 -0.37981,-2.71611 -0.53412,-0.88125 -7.68369,-1.46805 -7.8259,-1.49655 -4.19285,-0.83992 -4.43378,-3.32318 -7.43159,-4.32893 -0.61746,-0.20717 -1.3222,-0.53158 -1.96369,-0.51677 z m -83.81814,31.47715 c 0.88741,-0.89676 -0.97401,0.52652 0,0 z" /> + <path + id="rect30" + style="fill:#f9f9f9;stroke-width:0.264583" + d="m 507.90936,37.330101 h 55.26015 V 316.89684 H 507.90936 Z M -55.282452,286.078 H 538.42226 v 49.69312 H -55.282452 Z M -72.186882,71.966187 H -0.1733017 V 321.29134 H -72.186882 Z" /> + </g> +</svg> diff --git a/file_type_recogniser.php b/file_type_recogniser.php new file mode 100644 index 0000000..f160fb7 --- /dev/null +++ b/file_type_recogniser.php @@ -0,0 +1,84 @@ +<?php + +function file_type($path_to_file) { + $file_type_database = new finfo(FILEINFO_SYMLINK|FILEINFO_MIME_TYPE); + return $file_type_database->file($path_to_file); +} + + +function file_extension($path_to_file) { + #FILEINFO_EXTENSION introduced in php7.2.0 https://www.php.net/manual/en/fileinfo.constants.php + if(defined("FILEINFO_EXTENSION")) + { + $file_type_database = new finfo(FILEINFO_EXTENSION); + return "." . $file_type_database->file($path_to_file); + }else + { + $result=file_type($path_to_file); + + $optimus_prime = array( + 'text/plain'=>'.txt', + 'text/html'=>'.html', + 'text/php'=>'.php', + 'text/css'=>'.css', + 'application/javascript'=>'.js', + 'application/json'=>'.json', + 'application/xml'=>'.xml', + 'application/x-shockwave-flash'=>'.swf', + 'video/x-flv'=>'.flv', + 'image/png'=>'.png', + 'image/jpeg'=>'.jpe', + 'image/jpeg'=>'.jpeg', + 'image/jpeg'=>'.jpg', + 'image/gif'=>'.gif', + 'image/bmp'=>'.bmp', + 'image/vnd.microsoft.icon'=>'.ico', + 'image/tiff'=>'.tiff', + 'image/tiff'=>'.tif', + 'image/svg+xml'=>'.svg', + 'image/svg+xml'=>'.svgz', + 'application/zip'=>'.zip', + 'application/x-rar-compressed'=>'.rar', + 'application/x-msdownload'=>'.exe', + 'application/x-msdownload'=>'.msi', + 'application/vnd.ms-cab-compressed'=>'.cab', + 'audio/mpeg'=>'.mp3', + 'video/quicktime'=>'.qt', + 'video/quicktime'=>'.mov', + 'application/pdf'=>'.pdf', + 'image/vnd.adobe.photoshop'=>'.psd', + 'application/postscript'=>'.ai', + 'application/postscript'=>'.eps', + 'application/postscript'=>'.ps', + 'application/msword'=>'.doc', + 'application/rtf'=>'.rtf', + 'application/vnd.ms-excel'=>'.xls', + 'application/vnd.ms-powerpoint'=>'.ppt', + 'application/vnd.oasis.opendocument.text'=>'.odt', + 'application/vnd.oasis.opendocument.spreadsheet'=>'.ods' + ); + + if(!array_key_exists($result,$optimus_prime)) + { + return ".dat"; + }else + { + return $optimus_prime[$result]; + } + + } +} + +function get_icon($path_to_file) +{ + $file_ext="svg/icons/".file_extension($path_to_file).".svg"; + if(!file_exists($file_ext)) + { + return "svg/icons/.dat.svg"; + }else + { + return $file_ext; + } +} + +?> diff --git a/index.html b/index.html new file mode 100644 index 0000000..5a60526 --- /dev/null +++ b/index.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>shady file upload</title> + <link rel="stylesheet" type="text/css" href="style.css"> + </head> + + <body> + <div class="overlay" style="height: 100%;"> + <div class="vert2"> + <div id="header"> + <p class="logo">shady_file_upload</p> + </div> + + <div id="page"> + <div id="hero" class="overlay"> + <div id="arrows"> + <img src="arrow.svg" id="protoarrow" style="display: none"> + </div> + + <div class="vcenter"> + <p>file upload service</p> + <p class="big">that <span class="blue">just about works</span></p> + <p>most of the time</p> + </div> + </div> + + <div class="vcenter"> + <form action="/register.php"> + <h2>Get started</h2> + <div class="content"> + <p>Username</p> + <input type="text" id="username" name="username"> + <p>Password</p> + <input type="password" id="password" name="password"> + <p>Repeat Password</p> + <input type="password" id="password2" name="password2"> + <input type="submit" value="Sign up"> + <p style="font-size: 1.1em;">Already have an account? <a href="login.php">Sign in</a> + </div> + </form> + </div> + + + </div> + </div> + + <img src="bottom.svg" class="bgbottom"> + </div> + + <script src="arrows.js"></script> + + </body> + <html> diff --git a/sql/fileshare.sql b/sql/fileshare.sql new file mode 100644 index 0000000..f927ffc --- /dev/null +++ b/sql/fileshare.sql @@ -0,0 +1,49 @@ +drop database fileshare; + + + + + +create database fileshare; +use fileshare; + +/*base user information*/ +create table users ( + id int not null auto_increment, + username varchar(50) not null unique, + password varchar(100) not null unique, + primary key (id) +); + +/*table has only one owner and is identifyed by a number*/ +create table files ( + id int not null auto_increment, + owner int default null, + absolutepath varchar(500) not null, + type varchar(20) not null default 'data', + primary key (id), + foreign key (owner) references users(id) +); + +/*the user with userid is given some kind of access to the file with fileid*/ +/*there is no edit bit because it will be too dificult to implement prehaps a change bit is in order (but not an edit bit)*/ +/*might be beneficial to even go full minimalist and remove the remove bit and only have the view bit*/ +create table access ( + fileid int not null, + userid int not null, + canview boolean not null default true, + canremove boolean not null default false, + check (canview=true or canremove=true) , + foreign key (fileid) references files(id), + foreign key (userid) references users(id) +); + + + +/*basic info for testing purposes*/ +insert into users(username,password) values ("root","asdf"); +insert into users(username,password) values ("tester","tester"); +insert into files(owner,absolutepath,type) values (1,"/root/jiberish.sh","shell script"); +insert into access(fileid,userid,canview,canremove) values(1,2,true,false); +/*I am not sure why this passes ....*/ +insert into access(fileid,userid,canview,canremove) values(1,2,false,false); diff --git a/style.css b/style.css new file mode 100644 index 0000000..89442f4 --- /dev/null +++ b/style.css @@ -0,0 +1,181 @@ +html, body { + margin: 0; + height: 100%; +} + +body { + background: #f0f0f0; + color: black; + font-family: sans-serif; + overflow: hidden; +} + +#page { + display: flex; + flex: 1 0 0; + align-items: stretch; +} + +#page > * { + flex: 1 0 0; +} + +#header { + background: white; + margin: 0; + padding: 1rem; + font-size: 2em; +} + +.logo { + font-family: monospace; + margin: 0; +} + +#hero { + flex: 1.5 0 0; + position: relative; + font-size: 3.5rem; +} + +.vcenter { + display: flex; + flex-direction: column; + justify-content: center; +} + +#hero .bg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -5; +} + +#hero > * > p { + color: #676d75; + margin: 0rem; + padding: 0.5rem; + white-space: nowrap; + text-align: center; +} + +#hero .big { + font-size: 1.2em; +} + +.blue { + color: #231179; + font-weight: bold; +} + + +form { + background: white; + margin: 4.5rem; + padding-top: 0; + box-shadow: 0 0.8rem 1.3rem rgba(0,0,0,0.2); + border-radius: 0.5rem; + border-radius: 0.5rem; + border: 1px solid #b9b9b9; +} + +.vert { + justify-content: center; + display: flex; + flex-direction: column; +} + +.vert2 { + display: flex; + flex-direction: column; +} + +.overlay { + display: grid; +} + +.overlay > * { + grid-row: 1; + grid-column: 1; +} + +form > .content { + margin: 2rem; + margin-top: 1rem; + margin-bottom: 1.7rem; + padding: 0; + display: flex; + flex-direction: column; + justify-content: center; +} + +form > h2 { + color: #4d4d4d; + margin: 0; + text-align: center; + padding: 1rem; + background: #f0f0f0; + border-top-left-radius: 0.5rem; + border-top-right-radius: 0.5rem; +} + +form p { + margin: 1rem 0px 0.3rem 0px; +} + +input { + min-width: 300px; + border: 1px solid #bbb; + padding: 0.5rem; + font-size: inherit; + font-family: inherit; + border-radius: 0.3rem; + background: #fdfdfd; + transition: background 0.15s, border-color 0.35s; +} + +input[type=submit] { + cursor: pointer; + margin-top: 2rem; + width: 100%; + display: block; + padding: 0.7rem; + font-size: 1.1em; + box-shadow: 0 0.2rem 0.6rem #eee; + background: #231179; + color: white; +} + +input:focus, +input:hover { + background: white; +} + +input:focus { + border-color: black; +} + +input[type=submit]:hover { + background: #5b4d9d; +} + +.bgbottom { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + z-index: -100; +} + + +#arrows { + position: relative; +} + +#arrows > img { + position: absolute; + bottom: 0; + z-index: 200; +} diff --git a/svg/icons/.dat.svg b/svg/icons/.dat.svg new file mode 100644 index 0000000..69a4c60 --- /dev/null +++ b/svg/icons/.dat.svg @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg8" + sodipodi:docname="data.svg" + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="400" + inkscape:cy="560" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + inkscape:document-rotation="0" + showgrid="false" + inkscape:window-width="1918" + inkscape:window-height="1059" + inkscape:window-x="768" + inkscape:window-y="19" + inkscape:window-maximized="0" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:79.7512px;line-height:1.25;font-family:sans-serif;fill:#800080;fill-opacity:1;stroke:none;stroke-width:1.99379" + x="14.608006" + y="101.00649" + id="text74" + transform="scale(0.83843486,1.1926985)"><tspan + sodipodi:role="line" + id="tspan72" + x="14.608006" + y="101.00649" + style="fill:#800080;stroke-width:1.99379">Data</tspan></text> + </g> +</svg> diff --git a/svg/icons/.txt.svg b/svg/icons/.txt.svg new file mode 100644 index 0000000..db35ac4 --- /dev/null +++ b/svg/icons/.txt.svg @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg8" + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" + sodipodi:docname="txt.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="400" + inkscape:cy="560" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + inkscape:document-rotation="0" + showgrid="false" + inkscape:window-width="1918" + inkscape:window-height="1059" + inkscape:window-x="768" + inkscape:window-y="19" + inkscape:window-maximized="0" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;inline-size:15.4878;opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:0.264583;" + x="54.487259" + y="164.02113" + id="text12" + transform="matrix(11.172769,0,0,12.603914,-603.10178,-1943.9698)"><tspan + x="54.487259" + y="164.02113"><tspan + style="fill:#008080;stroke-width:0.264583">txt</tspan></tspan></text> + </g> +</svg> diff --git a/upload.php b/upload.php new file mode 100644 index 0000000..93fa778 --- /dev/null +++ b/upload.php @@ -0,0 +1,23 @@ +<?php + +if (!array_key_exists('uf', $_FILES)) { + http_response_code(400); + exit(); +} + + +$file = $_FILES['uf']; + + +if (file['error'] != 0) { + http_response_code(400); + exit(); +} + +$m = md5_file($file['tmp_name']); + +copy($file['tmp_name'], "screen/$m.png"); + +echo "http://india.fmi.fail/screen/$m.png"; + +?> |