Using unzip_file() to get contents of file
Using unzip_file() to get contents of file
Using unzip_file() to get contents of file
Upload automatically html files
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
Without seeing your htaccess file (all of it), you could be placing the commands in an improper spot. Or, your hosting provider may not allow those commands. Best bet for increasing the upload size it to contact your hosting support and ask how it should be done. It may be a setting that only they … Read more
Replicate Media Galley Edit view in Add Media View
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>’;
If you are using custom theme, please add this in the functions.php: add_theme_support( ‘post-thumbnails’ );
This will not work the way you are thinking. WordPress will try to upload attachments (images, pdfs, etc) to your server using the UPLOADS constant, this path is a file path, local to the server. If you wish to use a CDN you can get a CDN service to do this (manage files and upload … Read more
Looks like I was using this class to do this: http://gravitywiz.com/rename-uploaded-files-for-gravity-form/ and added the filter in myself after line 207, ie. // replace merge tags $form = GFAPI::get_form( $entry[‘form_id’] ); $value = GFCommon::replace_variables( $value, $form, $entry, false, true, false, ‘text’ ); // MOD: add a filter here to hook into filename change $value = apply_filters(‘gravity_forms_upload_filename’, … Read more
Thanks to @Kaperto, I found a .htaccess file in uploads folder and deleted that. Fortunately after that most of my images were back and the site started to work again. The loss of my data was less than 10 images, so I uploaded them again. Everything’s fine now. Still don’t know how the problem happened … Read more