HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/amberconcept/wp-content/plugins/woocommerce-upload-files/classes/com/WCUF_Ftp.php
<?php 
class WCUF_Ftp
{
	var $file_info_data = array();
	public function __construct()
	{
	}
	public function upload_file($file_path, $file_name)
	{
		$host = "";
		$port = 21;
		$ftp_user_name = "";
		$ftp_user_pass = "";
		$remote_path = "";
		$is_passive = true;
		
		if(!function_exists('ftp_connect'))
			return false;
		
		$conn_id = ftp_connect($host, $port);
		$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
		ftp_pasv($conn_id, $is_passive);
		
		$remote_path = substr($remote_path, -1) == '/' ? rtrim($remote_path, '/') : $remote_path;
		$remote_path = substr($remote_path, 0) != '/' ? '/'.$remote_path : $remote_path;
		$remote_file_path = trim($remote_path) ? $remote_path.$file_name : $file_name;
		
		if (!$conn_id || !$login_result)
		{
			return false;
		}		 
		else if (ftp_put($conn_id, $remote_file_path, $file_path, FTP_BINARY)) 
		{
			$host = substr($host, -1) == '/' ? rtrim($host, '/') : $host;
			$this->file_info_data['path'] = $host."/".$remote_file_path;
		} 
		else 
		{
			return false;
		}
		ftp_close($conn_id);	
		
		return $this->file_info_data;
	}
	
	public function delete_file($file_path, $remove_prefix = false)
	{
		
	}
}
?>