Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @novetrendy

    You must use a proxy PHP script to import files via FTP. Please see here for an explanation and example script: https://wordpress.org/support/topic/import-from-ftp-2/#post-8861657

    Thread Starter novetrendy

    (@novetrendy)

    HI @wpallimport

    Im figured out with function:

    
    function imgftp($x) {
    $image_name = $x;
    $remote_url = 'ftp://name:password@ftp.xxx.com:21/Images/' . $image_name;
    $local_image = 'https://path_to_folder/' . $image_name;
    $dir_to_save = '/usr/local/hosting/home/path_to_folder/';
    if (!is_dir($dir_to_save)) { mkdir($dir_to_save); }
    file_put_contents($dir_to_save . $image_name, file_get_contents($remote_url, true));
    $x = $local_image;
    return $x;
    }
    

    and in WP All Import [imgftp({image[1]})]

    • This reply was modified 5 years, 4 months ago by novetrendy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘File from FTP’ is closed to new replies.