summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornokonoko <neku@pomf.se>2013-10-29 16:43:17 +0100
committernokonoko <neku@pomf.se>2013-10-29 16:43:17 +0100
commitdf6cf936d7ef3a819c6ff484b24a8cb5946726a9 (patch)
treeb08744a7e5ee561b7c0f15d98d535d2dad2310c6
parent9c8308bdfc8bd61880978b0455dfe78ea88fffeb (diff)
Shitty code
-rw-r--r--LICENSE20
-rw-r--r--README.md4
-rw-r--r--faq.txt12
-rw-r--r--favicon.icobin0 -> 4119 bytes
-rw-r--r--img/10.pngbin0 -> 32305 bytes
-rw-r--r--img/2.pngbin0 -> 74594 bytes
-rw-r--r--img/3.pngbin0 -> 60684 bytes
-rw-r--r--img/4.pngbin0 -> 13529 bytes
-rw-r--r--img/5.pngbin0 -> 22713 bytes
-rw-r--r--img/6.pngbin0 -> 29307 bytes
-rw-r--r--img/7.pngbin0 -> 29732 bytes
-rw-r--r--img/8.pngbin0 -> 50050 bytes
-rw-r--r--img/9.pngbin0 -> 32272 bytes
-rw-r--r--img/bg.pngbin0 -> 19452 bytes
-rw-r--r--img/donate.pngbin0 -> 1098 bytes
-rw-r--r--index.html1
-rw-r--r--kawaii.php16
-rw-r--r--pomf.min.js1
-rw-r--r--style.min.css1
-rw-r--r--tits.php38
-rw-r--r--tools.txt39
-rw-r--r--upload.php85
22 files changed, 216 insertions, 1 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1a2fe26
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 nokonoko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index f96d0c5..d8689c7 100644
--- a/README.md
+++ b/README.md
@@ -2,4 +2,6 @@ Source code for Pomf.se
Code might work, or not. I might update this with the newest code, or not.
-Works best with Nginx+PHP5.5+MySQL. \ No newline at end of file
+Works best with Nginx+PHP5.5+MySQL.
+
+I can be contacted via neku@pomf.se or twitter at @nekunekus. \ No newline at end of file
diff --git a/faq.txt b/faq.txt
new file mode 100644
index 0000000..e6e536e
--- /dev/null
+++ b/faq.txt
@@ -0,0 +1,12 @@
+* Max file size is 50MB, hopefully I won't have to change this to a even lower number. (read: don't be an ass).
+* No Child porn, anything else goes until I get a lawsuit I guess. (unless its a virus, because that goes into the being an ass category).
+* All filetypes are allowed, ALL! (gif,exe,jpg,rar,ass,srt,etc,etc).
+* Any file can be removed or replaced at any time for any reason.
+* No logs are kept, no logs over uploading nor over downloading. This can be temp enabled to stop certain spamming (read: child porn or such).
+* a/i/pomf.se is hosted as for now on 500mbit server and Cloudflare's CDN helps out a lot, I'm on a restrained budget and this costs a lot so please don't be an ass.
+* I want to deliver the best free service I can without ads or such so donations are very welcome via the donate button on the front page (pomf.se).
+* Viruses will be removed if detected most of the time, this is to not cause further damage in form of i/a/pomf.se ending up on blacklists and whatnot. (read: IT ALREADY FUCKING IS!).
+* For removal of a file or such contact me at neku@pomf.se.
+
+>>Follow the rules and tips I have set up above, please. The FAQ may also be changed and updated at any time.
+>>Go to http://blog.pomf.se or http://twitter.com/nekunekus for more information.
diff --git a/favicon.ico b/favicon.ico
new file mode 100644
index 0000000..b115e11
--- /dev/null
+++ b/favicon.ico
Binary files differ
diff --git a/img/10.png b/img/10.png
new file mode 100644
index 0000000..226f062
--- /dev/null
+++ b/img/10.png
Binary files differ
diff --git a/img/2.png b/img/2.png
new file mode 100644
index 0000000..acb0a0b
--- /dev/null
+++ b/img/2.png
Binary files differ
diff --git a/img/3.png b/img/3.png
new file mode 100644
index 0000000..ca9eca5
--- /dev/null
+++ b/img/3.png
Binary files differ
diff --git a/img/4.png b/img/4.png
new file mode 100644
index 0000000..177db67
--- /dev/null
+++ b/img/4.png
Binary files differ
diff --git a/img/5.png b/img/5.png
new file mode 100644
index 0000000..b8dc3fe
--- /dev/null
+++ b/img/5.png
Binary files differ
diff --git a/img/6.png b/img/6.png
new file mode 100644
index 0000000..080335a
--- /dev/null
+++ b/img/6.png
Binary files differ
diff --git a/img/7.png b/img/7.png
new file mode 100644
index 0000000..60f7586
--- /dev/null
+++ b/img/7.png
Binary files differ
diff --git a/img/8.png b/img/8.png
new file mode 100644
index 0000000..cd2415e
--- /dev/null
+++ b/img/8.png
Binary files differ
diff --git a/img/9.png b/img/9.png
new file mode 100644
index 0000000..68b2018
--- /dev/null
+++ b/img/9.png
Binary files differ
diff --git a/img/bg.png b/img/bg.png
new file mode 100644
index 0000000..2f4febc
--- /dev/null
+++ b/img/bg.png
Binary files differ
diff --git a/img/donate.png b/img/donate.png
new file mode 100644
index 0000000..2132a83
--- /dev/null
+++ b/img/donate.png
Binary files differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..77689eb
--- /dev/null
+++ b/index.html
@@ -0,0 +1 @@
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1"><title>Pomf.se &middot; Kawaii File Hosting</title><link rel="shortcut icon" href=favicon.ico type="image/x-icon"/><link href=style.min.css rel=stylesheet></head><body><div class=container><div class=jumbotron><h1>Hai!</h1><p class=lead>Max upload size is 50MB & read the <a href="//pomf.se/faq.txt">FAQ</a></p><noscript><p class="alert alert-error"><strong>Enable JavaScript</strong> you fucking autist neckbeard, it's not gonna hurt you</p></noscript><p id=no-file-api class="alert alert-error"><strong>Your browser is shit.</strong> Install the latest<a href="http://firefox.com/">Firefox</a> or <a href="http://chrome.google.com/">Botnet</a> and come back &lt;3</p><a href="javascript:;" id=upload-btn class="btn ">Select <span>or drop </span>file(s)</a><input type=file id=upload-input name="files[]" multiple data-max-size=50MiB /><ul id=upload-filelist></ul></div><form action="https://www.paypal.com/cgi-bin/webscr" method=post target=_top><p class="alert alert-error"><input type=hidden name=cmd value="_s-xclick"><input type=hidden name=encrypted value="-----BEGIN PKCS7-----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-----END PKCS7-----"><strong>Look here!</strong> Virus scans are now a daily routine, if a file gets detected it will be removed without further notice. <br> Please <input type=image src="img/donate.png" name=submit alt=donate> to cover server costs, even $1 is appreciated. We accept Paypal via the donate button and bitcoins to <a class=btc href=bitcoin:1Hb5Xnn5vEJaH1atkJvzqFJq2DK3MAENWD>1Hb5Xnn5vEJaH1atkJvzqFJq2DK3MAENWD</a></p></form></div><nav><ul><li><a href="http://blog.pomf.se/">Pomf Blog</a></li><li><a href="irc://irc.pomf.se:6667#cute">Pomf IRC</a></li><li><a href="http://p.pomf.se/">Pomf Paste</a></li><li><a href="tools.txt">Upload Tools</a></li></ul></nav><script src=pomf.min.js></script></body></html>
diff --git a/kawaii.php b/kawaii.php
new file mode 100644
index 0000000..34bdce1
--- /dev/null
+++ b/kawaii.php
@@ -0,0 +1,16 @@
+<?php
+$images = array(
+ 'img/2.png',
+ 'img/3.png',
+ 'img/4.png',
+ 'img/5.png',
+ 'img/6.png',
+ 'img/7.png',
+ 'img/8.png',
+ 'img/9.png',
+ 'img/10.png'
+);
+if (headers_sent() === false) {
+ header('Location: ' . $images[array_rand($images)], true, 303);
+}
+?>
diff --git a/pomf.min.js b/pomf.min.js
new file mode 100644
index 0000000..f60cbec
--- /dev/null
+++ b/pomf.min.js
@@ -0,0 +1 @@
+var Zepto=function(){function t(t){return null==t?String(t):G[J.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(e){return"object"==t(e)}function o(t){return r(t)&&!n(t)&&t.__proto__==Object.prototype}function s(t){return t instanceof Array}function a(t){return"number"==typeof t.length}function u(t){return S.call(t,function(t){return null!=t})}function c(t){return t.length>0?N.fn.concat.apply([],t):t}function l(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function f(t){return t in A?A[t]:A[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function h(t,e){return"number"!=typeof e||j[l(t)]?e:e+"px"}function p(t){var e,n;return F[t]||(e=T.createElement(t),T.body.appendChild(e),n=_(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),F[t]=n),F[t]}function d(t){return"children"in t?L.call(t.children):N.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function v(t,e,n){for($ in e)n&&(o(e[$])||s(e[$]))?(o(e[$])&&!o(t[$])&&(t[$]={}),s(e[$])&&!s(t[$])&&(t[$]=[]),v(t[$],e[$],n)):e[$]!==x&&(t[$]=e[$])}function g(t,e){return null==e?N(t):N(t).filter(e)}function m(t,n,i,r){return e(n)?n.call(t,i,r):n}function y(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function b(t,e){var n=t.className,i=n&&n.baseVal!==x;return e===x?i?n.baseVal:n:(i?n.baseVal=e:t.className=e,void 0)}function E(t){var e;try{return t?"true"==t||("false"==t?!1:"null"==t?null:isNaN(e=Number(t))?/^[\[\{]/.test(t)?N.parseJSON(t):t:e):t}catch(n){return t}}function w(t,e){e(t);for(var n in t.childNodes)w(t.childNodes[n],e)}var x,$,N,O,P,C,z=[],L=z.slice,S=z.filter,T=window.document,F={},A={},_=T.defaultView.getComputedStyle,j={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},M=/^\s*<(\w+|!)[^>]*>/,k=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,B=/^(?:body|html)$/i,Z=["val","css","html","text","data","width","height","offset"],R=["after","prepend","before","append"],D=T.createElement("table"),U=T.createElement("tr"),q={tr:T.createElement("tbody"),tbody:D,thead:D,tfoot:D,td:U,th:U,"*":T.createElement("div")},I=/complete|loaded|interactive/,V=/^\.([\w-]+)$/,H=/^#([\w-]*)$/,Y=/^[\w-]+$/,G={},J=G.toString,K={},W=T.createElement("div");return K.matches=function(t,e){if(!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=W).appendChild(t),i=~K.qsa(r,e).indexOf(t),o&&W.removeChild(t),i},P=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},C=function(t){return S.call(t,function(e,n){return t.indexOf(e)==n})},K.fragment=function(t,e,n){t.replace&&(t=t.replace(k,"<$1></$2>")),e===x&&(e=M.test(t)&&RegExp.$1),e in q||(e="*");var i,r,s=q[e];return s.innerHTML=""+t,r=N.each(L.call(s.childNodes),function(){s.removeChild(this)}),o(n)&&(i=N(r),N.each(n,function(t,e){Z.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},K.Z=function(t,e){return t=t||[],t.__proto__=N.fn,t.selector=e||"",t},K.isZ=function(t){return t instanceof K.Z},K.init=function(t,n){if(t){if(e(t))return N(T).ready(t);if(K.isZ(t))return t;var i;if(s(t))i=u(t);else if(r(t))i=[o(t)?N.extend({},t):t],t=null;else if(M.test(t))i=K.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==x)return N(n).find(t);i=K.qsa(T,t)}return K.Z(i,t)}return K.Z()},N=function(t,e){return K.init(t,e)},N.extend=function(t){var e,n=L.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){v(t,n,e)}),t},K.qsa=function(t,e){var n;return i(t)&&H.test(e)?(n=t.getElementById(RegExp.$1))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:L.call(V.test(e)?t.getElementsByClassName(RegExp.$1):Y.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e))},N.contains=function(t,e){return t!==e&&t.contains(e)},N.type=t,N.isFunction=e,N.isWindow=n,N.isArray=s,N.isPlainObject=o,N.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},N.inArray=function(t,e,n){return z.indexOf.call(e,t,n)},N.camelCase=P,N.trim=function(t){return null==t?"":String.prototype.trim.call(t)},N.uuid=0,N.support={},N.expr={},N.map=function(t,e){var n,i,r,o=[];if(a(t))for(i=0;i<t.length;i++)n=e(t[i],i),null!=n&&o.push(n);else for(r in t)n=e(t[r],r),null!=n&&o.push(n);return c(o)},N.each=function(t,e){var n,i;if(a(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(i in t)if(e.call(t[i],i,t[i])===!1)return t;return t},N.grep=function(t,e){return S.call(t,e)},window.JSON&&(N.parseJSON=JSON.parse),N.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){G["[object "+e+"]"]=e.toLowerCase()}),N.fn={forEach:z.forEach,reduce:z.reduce,push:z.push,sort:z.sort,indexOf:z.indexOf,concat:z.concat,map:function(t){return N(N.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return N(L.apply(this,arguments))},ready:function(t){return I.test(T.readyState)?t(N):T.addEventListener("DOMContentLoaded",function(){t(N)},!1),this},get:function(t){return t===x?L.call(this):this[t>=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return z.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):N(S.call(this,function(e){return K.matches(e,t)}))},add:function(t,e){return N(C(this.concat(N(t,e))))},is:function(t){return this.length>0&&K.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==x)this.each(function(e){t.call(this,e)||n.push(this)});else{var i="string"==typeof t?this.filter(t):a(t)&&e(t.item)?L.call(t):N(t);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return N(n)},has:function(t){return this.filter(function(){return r(t)?N.contains(this,t):N(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!r(t)?t:N(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:N(t)},find:function(t){var e,n=this;return e="object"==typeof t?N(t).filter(function(){var t=this;return z.some.call(n,function(e){return N.contains(e,t)})}):1==this.length?N(K.qsa(this[0],t)):this.map(function(){return K.qsa(this,t)})},closest:function(t,e){var n=this[0],r=!1;for("object"==typeof t&&(r=N(t));n&&!(r?r.indexOf(n)>=0:K.matches(n,t));)n=n!==e&&!i(n)&&n.parentNode;return N(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=N.map(n,function(t){return(t=t.parentNode)&&!i(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return g(e,t)},parent:function(t){return g(C(this.pluck("parentNode")),t)},children:function(t){return g(this.map(function(){return d(this)}),t)},contents:function(){return this.map(function(){return L.call(this.childNodes)})},siblings:function(t){return g(this.map(function(t,e){return S.call(d(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return N.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null),"none"==_(this,"").getPropertyValue("display")&&(this.style.display=p(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var i=N(t).get(0),r=i.parentNode||this.length>1;return this.each(function(e){N(this).wrapAll(n?t.call(this,e):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){N(this[0]).before(t=N(t));for(var e;(e=t.children()).length;)t=e.first();N(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var i=N(this),r=i.contents(),o=n?t.call(this,e):t;r.length?r.wrapAll(o):i.append(o)})},unwrap:function(){return this.parent().each(function(){N(this).replaceWith(N(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=N(this);(t===x?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return N(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return N(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return t===x?this.length>0?this[0].innerHTML:null:this.each(function(e){var n=this.innerHTML;N(this).empty().append(m(this,t,e,n))})},text:function(t){return t===x?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(t,e){var n;return"string"==typeof t&&e===x?0==this.length||1!==this[0].nodeType?x:"value"==t&&"INPUT"==this[0].nodeName?this.val():!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:this.each(function(n){if(1===this.nodeType)if(r(t))for($ in t)y(this,$,t[$]);else y(this,t,m(this,e,n,this.getAttribute(t)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&y(this,t)})},prop:function(t,e){return e===x?this[0]&&this[0][t]:this.each(function(n){this[t]=m(this,e,n,this[t])})},data:function(t,e){var n=this.attr("data-"+l(t),e);return null!==n?E(n):x},val:function(t){return t===x?this[0]&&(this[0].multiple?N(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(e){this.value=m(this,t,e,this.value)})},offset:function(t){if(t)return this.each(function(e){var n=N(this),i=m(this,t,e,n.offset()),r=n.offsetParent().offset(),o={top:i.top-r.top,left:i.left-r.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(0==this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2&&"string"==typeof e)return this[0]&&(this[0].style[P(e)]||_(this[0],"").getPropertyValue(e));var i="";if("string"==t(e))n||0===n?i=l(e)+":"+h(e,n):this.each(function(){this.style.removeProperty(l(e))});else for($ in e)e[$]||0===e[$]?i+=l($)+":"+h($,e[$])+";":this.each(function(){this.style.removeProperty(l($))});return this.each(function(){this.style.cssText+=";"+i})},index:function(t){return t?this.indexOf(N(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return z.some.call(this,function(t){return this.test(b(t))},f(t))},addClass:function(t){return this.each(function(e){O=[];var n=b(this),i=m(this,t,e,n);i.split(/\s+/g).forEach(function(t){N(this).hasClass(t)||O.push(t)},this),O.length&&b(this,n+(n?" ":"")+O.join(" "))})},removeClass:function(t){return this.each(function(e){return t===x?b(this,""):(O=b(this),m(this,t,e,O).split(/\s+/g).forEach(function(t){O=O.replace(f(t)," ")}),b(this,O.trim()),void 0)})},toggleClass:function(t,e){return this.each(function(n){var i=N(this),r=m(this,t,n,b(this));r.split(/\s+/g).forEach(function(t){(e===x?!i.hasClass(t):e)?i.addClass(t):i.removeClass(t)})})},scrollTop:function(){return this.length?"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY:void 0},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=B.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(N(t).css("margin-top"))||0,n.left-=parseFloat(N(t).css("margin-left"))||0,i.top+=parseFloat(N(e[0]).css("border-top-width"))||0,i.left+=parseFloat(N(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||T.body;t&&!B.test(t.nodeName)&&"static"==N(t).css("position");)t=t.offsetParent;return t})}},N.fn.detach=N.fn.remove,["width","height"].forEach(function(t){N.fn[t]=function(e){var r,o=this[0],s=t.replace(/./,function(t){return t[0].toUpperCase()});return e===x?n(o)?o["inner"+s]:i(o)?o.documentElement["offset"+s]:(r=this.offset())&&r[t]:this.each(function(n){o=N(this),o.css(t,m(this,e,n,o[t]()))})}}),R.forEach(function(e,n){var i=n%2;N.fn[e]=function(){var e,r,o=N.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:K.fragment(n)}),s=this.length>1;return o.length<1?this:this.each(function(t,e){r=i?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null,o.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!r)return N(t).remove();w(r.insertBefore(t,e),function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},N.fn[i?e+"To":"insert"+(n?"Before":"After")]=function(t){return N(t)[e](this),this}}),K.Z.prototype=N.fn,K.uniq=C,K.deserializeValue=E,N.zepto=K,N}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(t){function e(t){return t._zid||(t._zid=p++)}function n(t,n,o,s){if(n=i(n),n.ns)var a=r(n.ns);return(h[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!a.test(t.ns)||o&&e(t.fn)!==e(o)||s&&t.sel!=s)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function r(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(e,n,i){"string"!=t.type(e)?t.each(e,i):e.split(/\s/).forEach(function(t){i(t,n)})}function s(t,e){return t.del&&("focus"==t.e||"blur"==t.e)||!!e}function a(t){return v[t]||t}function u(n,r,u,c,l,f){var p=e(n),d=h[p]||(h[p]=[]);o(r,u,function(e,r){var o=i(e);o.fn=r,o.sel=c,o.e in v&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?o.fn.apply(this,arguments):void 0}),o.del=l&&l(r,e);var u=o.del||r;o.proxy=function(t){var e=u.apply(n,[t].concat(t.data));return e===!1&&(t.preventDefault(),t.stopPropagation()),e},o.i=d.length,d.push(o),n.addEventListener(a(o.e),o.proxy,s(o,f))})}function c(t,i,r,u,c){var l=e(t);o(i||"",r,function(e,i){n(t,e,i,u).forEach(function(e){delete h[l][e.i],t.removeEventListener(a(e.e),e.proxy,s(e,c))})})}function l(e){var n,i={originalEvent:e};for(n in e)y.test(n)||void 0===e[n]||(i[n]=e[n]);return t.each(b,function(t,n){i[t]=function(){return this[n]=g,e[t].apply(e,arguments)},i[n]=m}),i}function f(t){if(!("defaultPrevented"in t)){t.defaultPrevented=!1;var e=t.preventDefault;t.preventDefault=function(){this.defaultPrevented=!0,e.call(this)}}}var h=(t.zepto.qsa,{}),p=1,d={},v={mouseenter:"mouseover",mouseleave:"mouseout"};d.click=d.mousedown=d.mouseup=d.mousemove="MouseEvents",t.event={add:u,remove:c},t.proxy=function(n,i){if(t.isFunction(n)){var r=function(){return n.apply(i,arguments)};return r._zid=e(n),r}if("string"==typeof i)return t.proxy(n[i],n);throw new TypeError("expected function")},t.fn.bind=function(t,e){return this.each(function(){u(this,t,e)})},t.fn.unbind=function(t,e){return this.each(function(){c(this,t,e)})},t.fn.one=function(t,e){return this.each(function(n,i){u(this,t,e,null,function(t,e){return function(){var n=t.apply(i,arguments);return c(i,e,t),n}})})};var g=function(){return!0},m=function(){return!1},y=/^([A-Z]|layer[XY]$)/,b={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(e,n,i){return this.each(function(r,o){u(o,n,i,e,function(n){return function(i){var r,s=t(i.target).closest(e,o).get(0);return s?(r=t.extend(l(i),{currentTarget:s,liveFired:o}),n.apply(s,[r].concat([].slice.call(arguments,1)))):void 0}})})},t.fn.undelegate=function(t,e,n){return this.each(function(){c(this,e,n,t)})},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,i){return!n||t.isFunction(n)?this.bind(e,n||i):this.delegate(n,e,i)},t.fn.off=function(e,n,i){return!n||t.isFunction(n)?this.unbind(e,n||i):this.undelegate(n,e,i)},t.fn.trigger=function(e,n){return("string"==typeof e||t.isPlainObject(e))&&(e=t.Event(e)),f(e),e.data=n,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(e)})},t.fn.triggerHandler=function(e,i){var r,o;return this.each(function(s,a){r=l("string"==typeof e?t.Event(e):e),r.data=i,r.target=a,t.each(n(a,e.type||e),function(t,e){return o=e.proxy(r),r.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.trigger(e)}}),["focus","blur"].forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.each(function(){try{this[e]()}catch(t){}}),this}}),t.Event=function(t,e){"string"!=typeof t&&(e=t,t=e.type);var n=document.createEvent(d[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0,null,null,null,null,null,null,null,null,null,null,null,null),n.isDefaultPrevented=function(){return this.defaultPrevented},n}}(Zepto),function(){EventEmitter=function(){},EventEmitter.prototype.on=function(t,e){this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e)},EventEmitter.prototype.off=function(t,e){this.hasOwnProperty("_events")&&t in this._events!=!1&&this._events[t].splice(this._events[t].indexOf(e),1)},EventEmitter.prototype.emit=function(t){if(this.hasOwnProperty("_events")&&t in this._events!=!1)for(var e=0,n=this._events[t].length;n>e;e++)this._events[t][e].apply(this,Array.prototype.slice.call(arguments,1))},FileList.prototype.forEach=Array.prototype.forEach,FileList.prototype.every=Array.prototype.every,FileList.prototype.some=Array.prototype.some,FileList.prototype.filter=Array.prototype.filter,FileList.prototype.map=Array.prototype.map,FileList.prototype.reduce=Array.prototype.reduce,FileList.prototype.reduceRight=Array.prototype.reduceRight,Object.defineProperty(FileList.prototype,"size",{get:function(){return this.reduce(function(t,e){return t+e.size},0)}});var t={get:function(){var t=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=Math.floor(Math.log(this.size)/Math.log(1024));return(this.size/Math.pow(1024,e)).toFixed(2)+" "+t[e]}};Object.defineProperty(FileList.prototype,"humanSize",t),Object.defineProperty(File.prototype,"humanSize",t);var e={get:function(){return this.uploadedSize/this.size}};Object.defineProperty(FileList.prototype,"percentUploaded",e),Object.defineProperty(File.prototype,"percentUploaded",e),Object.defineProperty(FileList.prototype,"uploadedSize",{get:function(){return this.reduce(function(t,e){return t+(e.uploadedSize||0)},0)}}),Object.defineProperty(File.prototype,"url",{get:function(){return window.URL.createObjectURL(this)}}),File.revokeURL=function(t){window.URL.revokeObjectURL(t)};var n=function(t,e){var n={};for(var i in e)n[i]=void 0===t[i]?e[i]:t[i];return n},i=function(t,e,i){this.url=t,this.files=e,i=i||{},this.opts=n(i,{field:"files[]",method:"POST"})};i.prototype=Object.create(EventEmitter.prototype),i.prototype.upload=function(t){t&&this.on("uploadcomplete",t);var e=this.opts,n=this.files,i=this,r=new FormData;n.forEach(function(t){r.append(e.field,t)});var o=new XMLHttpRequest;o.open(e.method,this.url,!0),o.upload.addEventListener("loadstart",function(){for(var t=0,e=n.length;e>t;t++)n[t].uploadedSize=0}),o.upload.addEventListener("progress",function(t){if(t.lengthComputable){size=t.loaded;for(var e=0,r=n.length;r>e;e++)n[e].uploadedSize=Math.min(size,n[e].size),size-=n[e].uploadedSize,0>=size&&(n.current=n[e],size=0)}i.emit("uploadprogress",t,n)},!1),o.upload.addEventListener("loadstart",function(t){i.emit("uploadstart",t)}),o.upload.addEventListener("load",function(t){i.emit("uploadcomplete",t)}),o.addEventListener("progress",function(t){i.emit("progress",t)}),o.addEventListener("load",function(t){i.emit("load",t,o.responseText)}),o.send(r)},FileList.prototype.upload=function(t,e){return new i(t,this,e)}}(),function(t){t.hasFileAPI=function(){return void 0!==window.FormData},t.fn.cabinet=function(e){e=t(e);var n=this,i=function(t,i,r,o){n.on(t,function(t){"click"===i?e[0].click():e.trigger(i),r&&t.preventDefault(),o&&o(t)},!1)};e[0].filelist=Object.create(FileList),e.on("change",function(t){this.filelist=t.target.files,n.change()}),i("dragenter","dragenter",!0),i("dragover","dragover",!0),i("dragleave","dragleave",!0),i("click","click",!1),i("drop","dragleave",!0,function(t){e[0].filelist=t.dataTransfer.files,n.change()})}}($),$(function(){var t=$("#upload-input"),e=$("#upload-btn"),n=$("#upload-filelist"),i="";$.hasFileAPI()||($("#no-file-api").show(),e.hide()),e.cabinet(t),e.on("dragenter",function(t){this===t.target&&($(this).addClass("drop"),i=$(this).html(),$(this).html("Drop it here~"))}),e.on("drop",function(){$(this).trigger("dragleave")}),e.on("dragleave",function(t){node=t.target;do if(node===this){$(this).removeClass("drop"),$(this).html(i);break}while(node=node.parentNode)});var r=function(t){var e=t.attr("data-max-size")||"10MiB",n=parseInt(/([0-9,]+).*/.exec(e)[1].replace(",","")),i=/(?:([KMGTPEZY])(i)?B|([BKMGTPEZY]))/.exec(e)||["B","",""],r=Math.pow("i"===i[2]?1024:1e3,"BKMGTPEZY".indexOf(i[1]));return n*r}(t),o=function(t,e,n){var i=$("<li class=file>"),r=$("<span class=file-name>"),o=$('<div class="file-progress progress-outer">'),s=$("<span class=file-size>"),a=$("<span class=file-url>");return i.addClass(n||""),$("<div class=progress-inner>").appendTo(o),i.attr("data-filename",escape(t)),r.text(t),s.text(e),i.append(r,o,s,a),i};e.on("change",function(){n.empty().removeClass("error completed");var e=t[0].filelist;e.forEach(function(t){o(t.name,t.humanSize).appendTo(n)});var i=o("",e.humanSize,"total");if(i.appendTo(n),e.size>r)return n.addClass("error"),$(".file-name",i).text("onii-chan y-your upload is t-too big&hellip;"),void 0;var s=e.upload("upload.php"),a=function(t,e){var n={};t.forEach(function(i){++n[i.name]||(n[i.name]=0);var r=$($('li[data-filename="'+escape(i.name)+'"]')[n[i.name]||0]);e.call(r,r,i,t)})},u=$(".file-name",i);s.on("uploadprogress",function(t,e){a(e,function(t,e){$(".progress-inner",t).width(100*e.percentUploaded+"%")}),$(".progress-inner",i).width(100*e.percentUploaded+"%")}),s.on("uploadcomplete",function(){$(".progress-inner").width("100%"),u.text("Grabbing URLs...")}),s.on("load",function(t,e){switch(t.target.status){case 200:var e=JSON.parse(e);if(!e.success){n.addClass("error"),$(".file-name",i).text("Something went wrong; try again later.");break}a(e.files,function(t,e){var n=$("<a>");n.attr("href","http://a.pomf.se/"+e.url).attr("target","_BLANK").text("a.pomf.se/"+e.url),$(".file-url",t).append(n)}),n.addClass("completed"),u.text("Done!");break;case 413:n.addClass("error completed"),u.html("onii-chan, y-your upload is t-too big&hellip;");break;default:n.addClass("error completed"),u.text("Something went wrong; try again later.")}}),s.upload()})}); \ No newline at end of file
diff --git a/style.min.css b/style.min.css
new file mode 100644
index 0000000..b8f9a96
--- /dev/null
+++ b/style.min.css
@@ -0,0 +1 @@
+*,:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{background-attachment:fixed,fixed;background-color:#F7F7F7;background-image:url(kawaii.php),url(img/bg.png);background-position:85% 100%,top left;background-repeat:no-repeat,repeat;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;height:100%;line-height:20px;margin:0;padding-top:20px;padding-bottom:40px}.container{margin:0 auto;max-width:700px}p{margin:0 0 10px}input[type=image],img{vertical-align:middle}a{color:#08C;text-decoration:none;transition:color .25s}a:hover,a:focus,a:active{color:#005580}a:focus{outline:thin dotted #333}.jumbotron{margin:60px 0;text-align:center;transition:width .5s,height .5s,margin .5s,padding .5s}.jumbotron h1{color:inherit;font-family:inherit;font-size:72px;font-weight:700;line-height:1;margin:10px 0;cursor:default;text-rendering:optimizelegibility}.jumbotron .lead{font-size:21px;font-weight:200;line-height:30px;margin-bottom:20px;transition:font-size .5s}.jumbotron .btn{background:rgba(202,230,190,.75);border:1px solid #B7D1A0;border-radius:4px;color:#468847;cursor:pointer;display:inline-block;font-size:24px;padding:28px 48px;text-shadow:0 1px rgba(255,255,255,.5);transition:background-color .25s,width .5s,height .5s}.jumbotron .btn:hover,.jumbotron .btn:active,.jumbotron .btn:focus,.jumbotron .btn.drop{background-color:#bce4aa;text-decoration:none}#no-file-api{display:none}.alert{background-color:#FCF8E3;border:1px solid #FBEED5;border-radius:4px;margin-bottom:20px;padding:8px 35px 8px 14px;text-shadow:0 1px rgba(255,255,255,.5);transition:width .5s,margin .5s,padding .5s,background-color .5s}.alert-error{background-color:#F2DEDE;border-color:#EED3D7;color:#B94A48}.alert-info{background-color:#D9EDF7;border-color:#BCE8F1;color:#3A87AD}a.btc{font-weight:700;color:#B94A48}a.btc:hover{color:#891A18}nav>ul,nav a{color:#3A87AD;list-style:none;margin:0;padding:0;text-align:center}nav>ul>li{display:inline-block;margin:0;padding:0;cursor:default}nav>ul>li:after{content:"|";margin:0 8px;opacity:.3}nav>ul>li:last-child:after{content:"";margin:0}#upload-input{position:absolute;top:0;left:-5000px}#upload-filelist{list-style-type:none;margin:20px 50px;padding:0;text-align:left}.error#upload-filelist{color:#891A18}.error#upload-filelist .file-size{color:#B94A48}.error#upload-filelist .file-progress{display:none}#upload-filelist>li{margin-top:5px;overflow:hidden}#upload-filelist>li.total{border-top:1px solid rgba(0,0,0,.05);font-weight:700;padding-top:5px}.file-name{float:left;overflow:hidden;max-width:70%;text-overflow:ellipsis;white-space:nowrap}.file-size,.file-url{display:inline-block;float:right;font-size:.9em;margin-left:8px;color:#5C5C5C;vertical-align:middle}.file-url a{color:#5C5C5C}.file-url a:hover{color:#1C1C1C}.completed .file-progress,.completed .file-size{display:none}.completed .file-url{display:block}.progress-outer{background-color:rgba(255,255,255,.8);border:1px solid #fff;border-radius:4px;box-shadow:0 0 0 1px #000;color:transparent;display:inline-block;font-size:0;float:right;height:8px;margin:6px 6px 0;overflow:hidden;vertical-align:middle;width:50px}.progress-inner{background-color:#000;height:6px;margin:0;width:0}.pocky{margin:20px auto;text-align:center}.pocky img{max-width:100%}@media only screen and (max-device-width:320px),only screen and (max-width:400px){body{padding:10px 0 0}.jumbotron{margin:20px 0 30px}.jumbotron .lead{font-size:18px}.jumbotron .btn,.alert,#upload-filelist{border-radius:0;border-width:1px 0;width:100%;margin-left:0;margin-right:0;padding-left:20px;padding-right:20px}#upload-filelist{background-color:rgba(255,255,255,.75);overflow:hidden}#upload-filelist>li.file{margin-top:12px;margin-bottom:12px}.file-progress{float:left;width:70%}.file-size{float:left;max-width:30%;overflow:hidden}.file-name,.file-url{width:100%;max-width:100%}.file-url a{text-decoration:underline;margin-left:15px}.file-url a:before{content:"http://"}.alert{font-size:13px}.alert-error{background-color:rgba(248,223,223,.75)}nav{background-color:rgba(255,255,255,.75);border:#FFF;padding:10px 0}}
diff --git a/tits.php b/tits.php
new file mode 100644
index 0000000..ffc90b2
--- /dev/null
+++ b/tits.php
@@ -0,0 +1,38 @@
+<?php
+function generate_nuck ($name, $tries) {
+ if (!isset($tries)) $tries = 5;
+ $ext = '.' . pathinfo($name, PATHINFO_EXTENSION);
+
+ do {
+ $newname = '';
+ for ($i = 4; $i > 0; $i--) {
+ $newname .= base_convert(mt_rand(0, 35), 10, 36);
+ }
+ $newname .= $ext;
+
+ if (--$tries == 0) return false;
+ } while (file_exists($newname));
+
+ return $newname;
+}
+
+function generate_neku ($name) {
+ if (!isset($tries)) $tries = 5;
+ $ext = '.' . pathinfo($name, PATHINFO_EXTENSION);
+
+ do {
+ $newname = '';
+ $newname .= mt_rand(0, 9);
+ $newname .= chr(mt_rand(ord("A"), ord("Z")));
+ $newname .= chr(mt_rand(ord("a"), ord("z")));
+ $newname .= mt_rand(0, 9);
+ $newname .= $ext;
+
+ if (--$tries == 0) return false;
+ } while (file_exists($newname));
+
+ return $newname;
+}
+?>
+<b>Nuck:</b> dicks.html --&gt; <?=generate_nuck("dicks.html");?><br />
+<b>Neku:</b> dicks.html --&gt; <?=generate_neku("dicks.html");?>
diff --git a/tools.txt b/tools.txt
new file mode 100644
index 0000000..dc716d5
--- /dev/null
+++ b/tools.txt
@@ -0,0 +1,39 @@
+Tools to upload images/files to Pomf.se
+
+* Pomf.se Windows Client - Uses old API(?)
+Download: http://mavanmanen.nl/index.php?page=projects
+Contact: https://twitter.com/mavanmanenDev
+
+* ScrotUP - Uses old API
+Download: https://github.com/mavanmanen/ScrotUP
+Contact: https://twitter.com/mavanmanenDev
+
+* Bash Pomf Uploader - Uses old API
+Download: https://gist.github.com/KittyKatt/5818701
+Contact: https://twitter.com/AnonymousLink
+
+* Perl Pomf Uploader - Uses old API
+Download: http://p.pomf.se/624
+Contact: N/A (Kori)
+
+* Bash Screenshot Uploader
+Download: https://gist.github.com/aki--aki/6258422
+Contact: https://twitter.com/__akiaki
+
+* Gyazo Client
+Download: https://github.com/Availu/gyazowin
+OR: http://availu.net/files/uploader-pomf.exe
+Contact: https://twitter.com/AVAILUUUUUUUU
+
+* Python Pomf Uploader
+Download: https://github.com/wahpomf/cocks420weeabofuck/blob/master/pomf.py
+Contact: https://twitter.com/FuzzyPomf
+
+* ShareX
+Download: http://code.google.com/p/sharex/
+Settings: http://a.pomf.se/457161945.PNG
+
+
+// Some of them might not work without tweaking since they use the old API (/new/up.php).
+
+Want your tool added here? Contact me at https://twitter.com/nekunekus or neku@pomf.se
diff --git a/upload.php b/upload.php
new file mode 100644
index 0000000..0d2ce74
--- /dev/null
+++ b/upload.php
@@ -0,0 +1,85 @@
+<?php
+function generate_name ($name, $grill) {
+ if (!isset($tries)) $tries = 5;
+ $ext = '.' . pathinfo($name, PATHINFO_EXTENSION);
+ $fuck = substr($grill, 0, 3);
+ do {
+ $newname = '';
+ $newname .= chr(mt_rand(ord("a"), ord("z")));
+ $newname .= $fuck;
+ $newname .= chr(mt_rand(ord("a"), ord("z")));
+ $newname .= $ext;
+
+ if (--$tries == 0) return false;
+ } while (file_exists('/mnt/disk1/pomf/files/'.$newname));
+
+ return $newname;
+}
+
+
+ //Upload and whatnot
+ function upload (){
+ $static_root = "/mnt/disk1/pomf/files/";
+ $out = array( "files" => array(), "success" => true);
+ $files = $_FILES["files"];
+ $num_files = count($files["name"]);
+
+ for ($i = 0; $i < $num_files; $i++) {
+ //Check if file exists already
+ $filehash = sha1_file($files["tmp_name"][$i]);
+ $con = new PDO('mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=XXX', 'XXX', 'XXX');
+ $do = $con->prepare("SELECT hash, filename FROM files WHERE hash = (:hash)");
+ $do->bindParam(':hash', $filehash);
+ $do->execute();
+ $result = $do->fetch();
+ $con = null;
+ if($result[0]==$filehash){
+ $out["files"][] = array(
+ "name" => $files["name"][$i],
+ "url" => $result[1]
+ );
+ }else{
+ $catshit = hash_file('crc32b', $files["tmp_name"][$i]);
+ $newname = generate_name($files["name"][$i], $catshit);
+ //Generate delid
+ $delid = sha1_file($files["tmp_name"][$i]);
+ //Try to upload and other shit
+ if ($newname && $files["error"][$i] == 0 && move_uploaded_file($files["tmp_name"][$i], $static_root.$newname)) {
+ //Get hash from file
+ $hash = sha1_file($static_root.$newname);
+ //Insert info into DB
+ $con = new PDO('mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=XXX', 'XXX', 'XXX');
+ $do = $con->prepare("INSERT INTO files (hash, orginalname, filename, size, date, expire, delid) VALUES (:hash, :orginname, :filename, :size, :date, :expire, :delid)");
+ $do->bindParam(':hash', $hash);
+ $do->bindParam(':orginname', $files["name"][$i]);
+ $do->bindParam(':filename', $newname);
+ $do->bindParam(':size', $files["size"][$i]);
+ $do->bindParam(':date', date('Y-m-d'));
+ $do->bindParam(':expire', $expire);
+ $do->bindParam(':delid', $delid);
+ $do->execute();
+ $con = null;
+ $out["files"][] = array(
+ "name" => $files["name"][$i],
+ "url" => $newname
+ );
+ //Otherwise return error
+ } else {
+ http_response_code(500);
+ echo json_encode(array(
+ "success" => false
+ ));
+ }
+ }
+ }
+ exit(json_encode($out, JSON_PRETTY_PRINT));
+}
+
+if(isset($_FILES["files"])){
+upload();
+}else{
+exit("What ya doing here nigga?");
+}
+
+
+?> \ No newline at end of file