add PHP_EOL to echoed url
add basic mime checking to prevent uploading of dangerous stuff