how to change wp upload directory to another domain directory

Well, what you want to achieve saving uploads in another domain? You want to share the uploads folder with another domain? Did you know you can use more than one domain (site) in a single WordPress Installation? It’s called Multisite: https://premium.wpmudev.org/blog/ultimate-guide-multisite/ To change the upload dir. Just use the filter upload_dir. It’s documented here: https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_dir … Read more

Uploads going to the root of wp-content/uploads

What else to check? First, deactivate all plugins and switch to a different theme. Then test uploads. If its fixed reactivate plugins/theme one at a time until you find the culprit. Next, you can check the database options table to see if the upload_path or upload_url_path have been altered, they should be blank. Then, you … Read more

Big file upload give HTTP error

That issue is not due to WordPress but due to your server configuration. Try increasing the PHP memory on the server as well as the max upload filesize. If you do not know how to do that please contact your hosting provider. Each server is different for that configuration therefore you won’t be able to … Read more

get array of files in uploads dir

You should also check if that dir exists and loop through the list_files if they exist. Since you asked for another idea to get those files: You can use the php function glob. It finds pathnames matching a pattern. You can find the Glob PHP manual here. $current_user = wp_get_current_user(); $upload_dir = wp_upload_dir(); $user_dirname = … Read more

Correctly using the root directory for media uploads?

The WordPress uploads directory’s path and URL are determined by the wp_upload_dir() function which applies a filter named upload_dir which you can use to fix the double slashes in the attachment URL. So if you turned off the “Organize my uploads into month- and year-based folders” setting, try the following: add_filter( ‘upload_dir’, function ( $data … Read more

Moving Existing images from custom directory to WP’s upload directory

Thanks for the response @jxxe. So I ended up figuring out how to do what I needed to do. For anyone else who might be needing the same thing, here’s what I did. Downloaded /assets/ directory via SFTP Commented out define(‘UPLOADS’, ‘assets’); in wp-config.php Uploaded contents of assets to /wp-content/uploads/ via SFTP Surprisingly, I didn’t … Read more

Set different max upload size limits based on file type/extension

This should work: function max_video_size( $file ) { $size = $file[‘size’]; $size = $size / 1024; $type = $file[‘type’]; $is_image = strpos( $type, ‘video’ ) !== false; $limit = 750; $limit_output=”750kb”; if ( $is_image && $size > $limit ) { $file[‘error’] = ‘Video files must be smaller than ‘ . $limit_output; } return $file; } … Read more

Move media files from the root to date folder structure

Normally, WordPress stores all your images and other media files in the /wp-content/uploads/ folder. To keep it structured, all files are stored in folders organized by year and month. The problem you will run into with reorganizing them is that links to the files in posts and pages will not update if you are simply … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)