⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.112
Server IP:
65.21.180.239
Server:
Linux gowhm.eplangoweb.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.0.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
eplangoweb
/
.trash
/
core
/
app
/
Http
/
Helpers
/
View File Name :
Uploader.php
<?php namespace App\Http\Helpers; class Uploader { public static function upload_picture($directory, $img): string { $file_name = sha1(time() . rand()); if(!file_exists($directory)){ if (!mkdir($directory, 0777, true)) { die('Failed to create folders...'); } } $ext = $img->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $img->move($directory, $newFileName); return $newFileName; } public static function update_picture($directory, $img, $old_img): string { $file_name = sha1(time() . rand()); if(!file_exists($directory)){ if (!mkdir($directory, 0777, true)) { die('Failed to create folders...'); } } $ext = $img->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $oldImgPath = $directory. '/' . $old_img; if (file_exists($oldImgPath)) @unlink($oldImgPath); $img->move($directory, $newFileName); return $newFileName; } }