Jan 6, 2016 05:31 AM
(This post was last modified: Jan 6, 2016 05:32 AM by Exodi.)
So I have a PHP file uploader to upload files with a watermark on it.
It totally works and it's a great script.
But it only allows JPG and JPEG extensions, and I'd like to add PNG.
I already tried this:
but that doesn't work. (only the JPG and JPEG works, but I tried to add PNG but only that doesn't work)
FULL PHP CODE: http://pastebin.com/QZeiqMVw
it was too large to post on HF
Tl;dr: I need PNG to be allowed as file extension in a PHP script
It totally works and it's a great script.
But it only allows JPG and JPEG extensions, and I'd like to add PNG.
I already tried this:
PHP Code
<?php
if ($_POST['submit'] && $_FILES['userfile']['size'] <= $maxkb && !file_exists($path . $_FILES['userfile']['name']) && $_FILES['userfile']['size'] && is_uploaded_file($_FILES['userfile']['tmp_name']) && (strtolower(substr($_FILES['userfile']['name'], -3)) == "jpg" || strtolower(substr($_FILES['userfile']['name'], -4)) == "png"))
FULL PHP CODE: http://pastebin.com/QZeiqMVw
it was too large to post on HF
Tl;dr: I need PNG to be allowed as file extension in a PHP script
pepe the frog
![[Image: otsgvt.png]](https://u.pomf.is/otsgvt.png)
![[Image: otsgvt.png]](https://u.pomf.is/otsgvt.png)


