3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Move the temporary uploaded file to its final location, // it should be available at the location "/tmp/boxed/success/agentSvcfRiuOSj5em1t.pdf". $path = '/tmp/boxed/success/'; $mimes = [ 'application/pdf', 'application/x-pdf' ]; $file = $_FILES['agentSvcfRiuOSj5em1t.pdf']; $fileName = $file['name']; if (file_exists($file['name'])) { throw new \Exception('file does not exist'); } if (in_array($mimes,$file['mime'])) { throw new \Exception('mime type not allowed'); } do_move($file['name'], $path.$fileName); ?>

preferences:
36.96 ms | 402 KiB | 5 Q