IMHO a better approach would be adding the remote server’s directory as a locally mounted directory and use this as wp-content directory. Doing this on the block/filesystem level means that WordPress won’t notice a thing, since it appears to WordPress as normal local directory. You may want to have a look at sshfs in order to mount the directory. Using this has the added benefits of:
- not having to put your ftp password in file
- no (slow/unreliable) php code having to act as ftp client
- no need for ftp an insecure protocol by itself
- no need for a ftp-server on the remote server
- no need to change WordPress config
Related Posts:
- Maximum upload size changes in php.ini ignored – How to remove upload size limit?
- HTTP Error after finishing uploading a video that is bigger than 64 MB -> After raising the upload limit manually in the wp-config file
- Using Windows Server 2012 How to Move Uploads Folder to another hard drive
- Store uploads on an external server?
- How to show all available images in WP’s media library when using the Polylang plugin?
- retrieve custom image sizes from media uploader javascript object
- Is it possible to allow zip files to be uploaded in WordPress?
- WordPress monthly upload directory owner set to root
- Append button to WordPress Image Details modal
- How to set custom upload directory per user after moving content directory
- Importing WordPress Attachments Into Custom Directories In wp-content/uploads/
- This file type is not allowed. Please try another
- Post type specific upload folder in 3.5
- How to get profile user id when uploading image via media uploader on profile page
- HTTP Error when uploading images
- Accessing Media/Files outside the_content
- Media uploader not work properly [closed]
- “HTTP error” randomly on image uploads
- View content from uploaded file in editor
- Media upload – choose only one file
- Add suffix to filename of uploaded images
- WordPress cannot upload data after migration
- How to rewrite WordPress uploads folder to another folder using htaccess
- How To install AWS SDK for PHP in wordpress?
- Add fields to the WordPress media uploader
- wp_editor in front end not working
- How to safely allow user upload on CPTs?
- How to upload unknown file type?
- Upload file without attaching it to a POST
- WooCommerce Images are uploading to the server but not attaching
- Why would media_sideload_image() not work locally?
- The uploaded file exceeds the upload_max_filesize directive in php.ini
- Media upload on WordPress changes title of image
- Upload file programmatically
- remove_accents does not seem to work (when used inside sanitize_file_name filter)
- Remove upload file types filter for admin
- wrong media url in wordpress
- Prevent small image sizes from being uploaded
- Front-End Social photo upload [closed]
- Protecting uploads not working
- How to upload a file from WP directory automatically?
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- Hide images from anonymous user?
- cannot upload anything into wordpress
- Limit image upload
- Is there any good way to use SVN for uploads directory?
- Uploaded images do not show on localhost
- WordPress Drag n Drop Uploader – Single File Only
- Multi Upload In Theme Options
- How to load attachment in media library for current user?
- Why does get_dirsize return the same size?
- How To Watermark Audio
- Maximum post size?
- tb_show not showing a media upload window . custom plugin
- In the media Rest API, what is “missing_image_sizes”?
- Storing WordPress Media Library Uploaded files onto a separate domain
- Error: The uploaded file exceeds the upload_max_filesize directive in php.ini [duplicate]
- Creating a podcast directory site – how to allow user to upload “large” files?
- Migrating media files (documents only) to a fresh install and maintaining the same directory structure
- get array of files in uploads dir
- Is there a way a user/member can upload a file and link it in his profile page?
- how to disable WordPress flash up-loader?
- Send an e-mail notification to custom user role when a file is uploaded to uploads folder
- Resize uploaded original images to a minimum automatically
- WordPress Thumbnail compression depends on the server?
- Better solution for managing media attachments with `wp_editor()`?
- Upload PDF and other files from the Front-End
- Custom Text in Media Uploader in a Theme Options Page
- How to disable image thumbnails from media manager but not post media uploader?
- Do custom post type (CPT) attachments/media store the parent post ID?
- Certain functions are not available when executed with wp_schedule_event
- Upload image fails “upload test” on localhost
- Get uploaded video URL
- How Do I Change the File Permission For Uploaded Files in WordPress?
- WordPress media has all disappeared on wp-admin but still on the server
- The uploaded file exceeds the upload_max_filesize directive in php.ini. showing while uploading a theme
- image not display in media library and thumbnail not display in post
- How to upload .tex files in wordpress?
- Which WordPress file controls the featured image upload maximum width and height of 3000px
- Moving wp-content folder to public_html
- An error occurred in the upload. Please try again later
- Using Gravity Forms to upload media into library, then attach to post
- Some images not appearing after switching from AWS S3 back to local
- Uploading a file results in attachment post, but file is missing
- Why I am not able to upload media files?
- Featured image to grayscale with PHP imagefilter – which hook to use?
- Force relative path in media library for LAN deployment
- WordPress Media manager select file button, how to prevent hiding?
- Make thumbnail from uploaded image without plugin
- Limit number of uploaded attachments of specific context
- Set featured link not showing
- WordPress upload folder on separate server
- increase maximum upload file
- How i can upload images to another folder?
- make default upload folder year/month/day wordpress without plugin [duplicate]
- Display Image Upload from Contact Form 7 on Redirect Page [closed]
- media_handle_sideload() fails
- How to upload and add images to the existing post from the front-end with admin approval which is posted by other user
- Updating Media Library PDF’s in bulk
- Assign multiple categories to Media Library upload