regarding FTP and SFTP within WP
-
Hello, recently i’ve been considering WP’s built-in FTP functionality for the purpose of remote uploading images from media library to the CDN service with a limited WP integration.
I’ve found about WP configs constants definitions that are supporting ‘FTP_CONTENT_DIR’ and ‘FTP_PLUGINS_DIR’ and so tried to define ‘FTP_UPLOADS’
by adding a new constant definition into:
wp-admin/includes/class-wp-filesystem-base.php
public function find_folder( $folder ) { -- if ( stripos( $this->method, 'ftp' ) !== false ) { $constant_overrides = array( 'FTP_BASE' => ABSPATH, 'FTP_CONTENT_DIR' => WP_CONTENT_DIR, 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR, 'FTP_UPLOADS' => WP_UPLOAD_DIR,
Afterwards i’ve set the wp-config.php:
//FTP define('FS_METHOD', 'direct'); define('FTP_BASE', '/export/home/123-user/htdocs/uploads/'); //define('FTP_CONTENT_DIR', '/export/home/123-user/htdocs/'); define('FTP_UPLOADS', '/export/home/123-user/htdocs/uploads/'); //define('UPLOADS', 'uploads'); define('FTP_USER', '123-user'); define('FTP_PASS', 'password123'); define('FTP_HOST', '123-user.server.co'); /* That's all, stop editing! Happy publishing. */
No server errors but also no files transferred with the above customization.
Is there possibility that above technique could work with your plugin SSH SFTP Updater Support?
Any advice on this subject really appreciated, thank you regards
- The topic ‘regarding FTP and SFTP within WP’ is closed to new replies.