Picture upload issue – broken thumbnail

This is not something that can be answered without more info. What exactly means “uploaded by FTP”? Do you upload the files and then manually insert the address into the Source Code? What happens if you / the client directly tries to access the files by typing in the URL into the Browser Address Bar? … Read more

Where to store sensitive uploaded file?

Upload files at anywhere ( normally create your own folder inside wp-content/uploads folder ), you can create .htaccess file and index.html files inside the folder to restrict the files from direct access. Keep index.html blank and add deny from all text in .htaccess file.

Front-End Upload media with category

Maybe you can assign attachment to those categories after upload? Check this example. function add_category_automatically($post_ID) { $attach = get_post($post_ID); if ($attach->post_parent) { $cats = get_the_category()($attach->post_parent); foreach ($cats as $cat) { wp_set_object_terms($post_ID, $cat->slug, ‘category’, true); } } } add_action(‘add_attachment’, ‘add_category_automatically’); Source

wp_handle_upload specified file failed upload test

Please add below code in your theme functions.php file : add_filter( ‘wp_check_filetype_and_ext’, ‘file_and_ext_allow_for_user’, 10, 4 ); function file_and_ext_allow_for_user( $types, $file, $filename, $mimes ) { if( false !== strpos( $filename, ‘.doc’ ) ) { $types[‘ext’] = ‘doc’; $types[‘type’] = ‘application/msword’; } else if( false !== strpos( $filename, ‘.pdf’ ) ) { $types[‘ext’] = ‘pdf’; $types[‘type’] = … Read more

How to allow .xls file uploads?

Try the same function but different $mime_types key (‘xla|xls|xlt|xlw’): <?php function my_myme_types( $mime_types ){ // New allowed mime types. $mime_types[‘xla|xls|xlt|xlw’] = ‘application/vnd.ms-excel’; return $mime_types; } add_filter( ‘upload_mimes’, ‘my_myme_types’, 1, 1 ); To get MIME type array keys and values used by WordPress: <?php $mimes = wp_get_mime_types(); echo ‘<pre>’; print_r( $data ); echo ‘</pre>’;

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