Flatten media files in uploads directory via linux terminal eliminating thumbnails?

Warning: Please make a backup first, as this can do irreversable damage. Go to your uploads directory: cd /path/to/directory cp -r uploads uploads.backup Flatten the files in uploads directory: find * -type f -exec bash -c ‘file=${1#./}; echo mv “$file” “${file//\//_}”‘ _ ‘{}’ \; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2017/12/some-image-150×150.jpg —> 2017_12_some-image-150×150.jpg 2017/12/some-image-360×240.jpg —> 2017_12_some-image-360×240.jpg 2017/12/some-image-720×900.jpg —> 2017_12_some-image-720×900.jpg 2017/12/some-image.jpg … Read more

Uploading dwg files to wordpress

Your code should work just fine. The only problem in there is that you’ve set incorrect mime type, I guess… It should be image/vnd.dwg. So this one should work: function custom_upload_mimes ( $existing_mimes=array() ) { $existing_mimes[‘dwg’] = ‘image/vnd.dwg’; return $existing_mimes; } add_filter(‘upload_mimes’, ‘custom_upload_mimes’);

Cannot upload .mp3 file to wordpress media

you need to allow them to be uploaded in your media files. you can add following code to your themes functions.php function my_mime_types($mime_types){ $mime_types[‘mp3’] = ‘audio/mpeg’; return $mime_types; } add_filter(‘upload_mimes’, ‘my_mime_types’, 1, 1); there is more information about adding new mime types in WP here: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/#add-filetypes And here a list of the mime_types: https://feedforall.com/mime-types.htm

What types of files can I upload with the WordPress Uploader?

From http://codex.wordpress.org/Uploading_Files : WordPress supports uploading the following file types: Images .jpg .jpeg .png .gif Documents .pdf (Portable Document Format; Adobe Acrobat) .doc, .docx (Microsoft Word Document) .ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation) .odt (OpenDocument Text Document) .xls, .xlsx (Microsoft Excel Document) Audio .mp3 .m4a .ogg .wav Video .mp4, .m4v (MPEG-4) .mov (QuickTime) .wmv … Read more

Unable to Upload Images on Local Windows Install

After trying many things with permissions, I found my problem. I uses a plugin called Duplicator to move WordPress installs around from server to server, it handles changing URLS’s and Paths. So in settings => Media => Store uploads in this folder it was setting the Full Filepath to my Uploads folder. I changed it … Read more

Placing assets for external use

I have used symbolic links for convenience for awhile on a dev server but they are not 100% reliable as some PHP functions will return the filesystem path of the target instead of the path to the symlink itself. The most notable example (though not really a function) is the magic constant __FILE__. (Also https://bugs.php.net/bug.php?id=46260) … Read more

How do I modify the url of uploaded media content?

Use a plugin like Deploy Helper. Essentially, it allows you to swap out all instances of one URL with another, and will also handle serialized data. Just enter the old URL as media.detailsofmylife.net/uploads and the new one as www.detailsofmylife.net/wp-content/uploads. Make sure you also reset your custom upload paths. If you’d defined constants like WP_CONTENT_URL or … Read more

Insert Image automatically when upload finishes wordpress media uploader

The hook for doing stuff after an upload is the reset event on wp.Uploader.queue triggered by the pluploader when it’s finished (see line 249 in “wp-includes/js/plupload/wp-plupload.js”). Here’s one hack to use this to do an auto-insert after an upload: function wpse167143_admin_footer() { ?> <script> jQuery( document ).ready(function() { typeof wp.Uploader !== ‘undefined’ && wp.Uploader.queue.on( ‘reset’, … Read more

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