Organizing media uploads

First, I assume the problem isn’t as much 1M files, but your server unable to handle it? Logically it worked elsewhere, right? My opinion is that presenting is as a “problem” to the client might be a little one sided. It’s in realm of technical possibility, but it won’t be a smooth process. WP stores … Read more

Different upload path per file type

Change upload directory for PDF Files seems to be a good stepping stone forward. Although untested, looking at the code my adaptation would be along the lines of… <?php add_filter(‘wp_handle_upload_prefilter’, ‘custom_media_library_pre_upload’); add_filter(‘wp_handle_upload’, ‘custom_media_library_post_upload’); function custom_media_library_pre_upload($file){ add_filter(‘upload_dir’, ‘custom_media_library_custom_upload_dir’); return $file; } function custom_media_library_post_upload($fileinfo){ remove_filter(‘upload_dir’, ‘custom_media_library_custom_upload_dir’); return $fileinfo; } function custom_media_library_custom_upload_dir($path){ $extension = substr(strrchr($_POST[‘name’],’.’),1); if ( !empty( … Read more

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