403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/holidays.tripjack.com/library/Helper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/holidays.tripjack.com/library/Helper/FileUpload.php
<?php
/*
 * Catabatic Technology Pvt. Ltd.
 * File Name :FileUpload.php
 * File Description :Helper For Uploading the files
 * Created By : Pardeep Panchal
 * Created Date: 03-Auguest-2016
 */
class Zend_Controller_Action_Helper_FileUpload extends Zend_Controller_Action_Helper_Abstract
{
   
    public function upload($strDestinationFolder,$strIcon)
    {
        
        
        if(!file_exists($strDestinationFolder)){
            mkdir($strDestinationFolder, 0777);
        }

        $upload = new Zend_File_Transfer_Adapter_Http();
        $upload->addFilter('Rename', $strDestinationFolder.$strIcon); // Rename Orignal File ...
        $upload->setDestination($strDestinationFolder);

        try {
            $upload->receive();  // This takes care of the moving and making sure the file is there
        } catch (Zend_File_Transfer_Exception $e) {
            echo $e->message();
        }
        
        
    }
    public function uploadToAWS($data){
        $FILES = $data['FILES'];
        $AgencySysId = $data['AgencySysId'];
        $image_path = $data['image_path'];
        $tags = $data['tags'];
        $title = $data['title'];
        $fileName = $data['fileName'];
         
        $apiData['agency_name'] = $image_path;
        $apiData['agency_id'] = $AgencySysId;
        $apiData['alt_tags'] = $tags;
        $apiData['title'] = $title;
        $cfile = new CURLFile($FILES['tmp_name'], $FILES['type'], $fileName);
        $apiData['document'] = $cfile;
        //echo "<pre>";print_r($apiData);die;
        $curl = curl_init();
        curl_setopt_array($curl, array(
          CURLOPT_URL => 'https://img.hellogtx.com/image-upload/',
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_ENCODING => "",
          CURLOPT_MAXREDIRS => 10,
          CURLOPT_TIMEOUT => 30,
          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
          CURLOPT_CUSTOMREQUEST => "POST",
          CURLOPT_POSTFIELDS => $apiData,
          CURLOPT_HTTPHEADER => array(
            "cache-control: no-cache",
            "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
            "gtxkey: DFRT5634@GHUYPO123458910RTY",
            "postman-token: 05105a87-092d-74ea-3173-e9e167160b99"
          ),
        ));

        $response = curl_exec($curl);
       //echo "<pre>";print_r($response);die;
        $err = curl_error($curl);
        curl_close($curl);

        if ($err) {
            return array('status' => false,'message' => "cURL Error #:" . $err);
        } else {
            return (!empty($response)) ? json_decode($response,1) : '';
        }
    }
    public function getFileFromAWS($data){
        $AgencySysId = $data['AgencySysId'];
        $folderName = trim($data['folderName']);
        $titleName = trim($data['titleName']);
        //$folderName = 'doc/'.$AgencySysId.'/vouchers/'.$TPSysId.'/'.$fullVoucherName.'.pdf';
        if(!empty($folderName)){
            $url111 = "https://img.hellogtx.com/image-upload/?document=$folderName&agency_id=$AgencySysId";
        }else if(!empty($titleName)){
            $url111 = "https://img.hellogtx.com/image-upload/?title=$titleName&agency_id=$AgencySysId";
        }
        
        
        $curl = curl_init();

        curl_setopt_array($curl, array(
          CURLOPT_URL => $url111,
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_ENCODING => "",
          CURLOPT_MAXREDIRS => 10,
          CURLOPT_TIMEOUT => 30,
          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
          CURLOPT_CUSTOMREQUEST => "GET",
          CURLOPT_HTTPHEADER => array(
            "cache-control: no-cache",
            "gtxkey: DFRT5634@GHUYPO123458910RTY",
            "postman-token: cea34a74-6e97-580c-d4fd-c8a20bdbba34"
          ),
        ));

        $response = curl_exec($curl);   
        $responseArr = json_decode($response,1); 
        $err = curl_error($curl);
        curl_close($curl);
        if ($err) {
            return array('status' => false,'message' => "cURL Error #:" . $err);
        } else {
            return $responseArr;
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit