woocommerce with external ftp site
fortunately ftp server had install nginx and i used x-accel-redirect inside downlod server to solve my problem. thanks for your helps:)
fortunately ftp server had install nginx and i used x-accel-redirect inside downlod server to solve my problem. thanks for your helps:)
It turns out the value that points to the PDFs’ locations on disk is stored in the wp_postmeta table, under the meta_value field. For example a media item located at site.com/app/uploads/2019/06/whatever.pdf would have a meta_value value of 2019/06/whatever.pdf. To change the location of all PDFs I first found the IDs of all PDFs (from the … Read more
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
Remove special characters from filenames
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
How wordpress handle urls present in db for external wp-content directory
yes use this code here you can get attachment id if(isset($_FILES[‘myimage’]) && ($_FILES[‘myimage’][‘size’] > 0)) { // Get the type of the uploaded file. This is returned as “type/extension” $arr_file_type = wp_check_filetype(basename($_FILES[‘myimage’][‘name’])); $uploaded_file_type = $arr_file_type[‘type’]; // Set an array containing a list of acceptable formats $allowed_file_types = array(‘image/jpg’, ‘image/jpeg’, ‘image/gif’, ‘image/png’); if (in_array($uploaded_file_type, $allowed_file_types)) { … Read more
Replicate Media Galley Edit view in Add Media View
Front-end uploader logging user out when they attempt to upload image
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>’;