1. Go to this page and download the library: Download simpsyst/uploader library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
simpsyst / uploader example snippets
ge = new SimpSyst\Uploader\Image("uploads", "images", 600);
if ($_FILES) {
try {
$upload = $image->upload($_FILES['image'], $_POST['name']);
echo"<img src='{$upload}' width='100%'>";
} catch (Exception $e) {
echo"<p>(!) {$e->getMessage()}</p>";
}
}
e = new SimpSyst\Uploader\File("uploads", "files");
if ($_FILES) {
try {
$upload = $file->upload($_FILES['file'], $_POST['name']);
echo"<p><a href='{$upload}' target='_blank'>@SimpSyst</a></p>";
} catch (Exception $e) {
echo"<p>(!) {$e->getMessage()}</p>";
}
}
ia = new SimpSyst\Uploader\Media("uploads", "medias");
if ($_FILES) {
try {
$upload = $media->upload($_FILES['file'], $_POST['name']);
echo"<p><a href='{$upload}' target='_blank'>@SimpSyst</a></p>";
} catch (Exception $e) {
echo"<p>(!) {$e->getMessage()}</p>";
}
}