$24 GRAYBYTE WORDPRESS FILE MANAGER $21

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.malloca.com/wp-content/plugins/loco-translate/src/data/

HOME
Current File : /home/bqrcodec/contact.malloca.com/wp-content/plugins/loco-translate/src/data//Upload.php
<?php
 /**
  * Simple wrapper for transient file uploads carrying PO data.
  * Doesn't move or persist uploaded files, so doesn't call wp_handle_upload()
  */
 class Loco_data_Upload {

     /**
      * Actual file currently on system
      * @var Loco_fs_File
      */
     private $file;

     /**
      * @var array
      */
     private $data;


     /**
      * Pass through temporary file data
      * @param string key in $_FILES known to exist
      * @return string
      * @throws Loco_error_UploadException
      */
     public static function src($key){
         $upload = new Loco_data_Upload($_FILES[$key]);
         return $upload->getContents();
     }
     

     /**
      * @param array member of $_FILE
      * @throws Loco_error_UploadException
      */
    public function __construct( array $data ){
        $this->data = $data;
        // https://www.php.net/manual/en/features.file-upload.errors.php
        $code = (int) $data['error'];
        switch( $code ){
        case UPLOAD_ERR_OK:
            break;
        case UPLOAD_ERR_INI_SIZE:
            throw new Loco_error_UploadException('The uploaded file exceeds the upload_max_filesize directive in php.ini',$code);
        case UPLOAD_ERR_FORM_SIZE:
            throw new Loco_error_UploadException('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',$code);
        case UPLOAD_ERR_PARTIAL:
            throw new Loco_error_UploadException('The uploaded file was only partially uploaded',$code);
        case UPLOAD_ERR_NO_FILE:
            throw new Loco_error_UploadException('No file was uploaded, or data is empty',$code);
        case UPLOAD_ERR_NO_TMP_DIR:
            throw new Loco_error_UploadException('Missing temporary folder for uploaded file',$code);
        case UPLOAD_ERR_CANT_WRITE:
            throw new Loco_error_UploadException('Failed to save uploaded file to disk',$code);
        case UPLOAD_ERR_EXTENSION:
            throw new Loco_error_UploadException('Your server blocked the file upload',$code);
        default:
            throw new Loco_error_UploadException('Unknown file upload error',$code);
        }
        // upload is OK according to PHP, but check it's really readable and not empty
        $path = $data['tmp_name'];
        $file = new Loco_fs_File($path);
        if( ! $file->exists() ){
            throw new Loco_error_UploadException('Uploaded file is not readable',UPLOAD_ERR_NO_FILE);
        }
        if( 0 === $file->size() ){
            throw new Loco_error_UploadException('Uploaded file contains no data',UPLOAD_ERR_NO_FILE);
        }
        // file is really ok
        $this->file = $file;
    }


     /**
      * @return string
      */
     public function getName(){
         return $this->data['name'];
     }


     /**
      * @return string
      */
     public function getContents(){
         return $this->file->getContents();
     }

 }
 

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
CompiledData.php
1.869 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Cookie.php
1.829 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Option.php
1.282 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Permissions.php
5.81 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Preferences.php
4.644 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
RecentItems.php
2.942 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Serializable.php
5.001 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Session.php
4.659 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Settings.php
8.044 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Transient.php
1.788 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Upload.php
2.869 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF