UploadPlus : File Name Cleaner
[resolved] [Plugin: Upload+] File name suffix (3 posts)

  1. difreo
    Posted 5 years ago #

    I added option "wordpress style" wich adds the suffix to the filename just like the wordpress uploader does it. If the filename is not unique, then a number will be added to the filename before the extension, and will continue adding numbers until the filename is unique. I think its better then the looong timestamps etc. I hope the author will check this out.

    In the plugins uploadplus.php
    added to the switch:

    $standard = get_option('uploadplus_prefix');
    //here goes the standard code
    //and below what i added
    case "B":
    $uploads = wp_upload_dir();
    $dir = ( $uploads['path'] );
    $filename = wp_unique_filename( $dir, $file_name, $unique_filename_callback = null );
    $file_name = $filename;

    and here:

    $otherstyles = array(
    	"7" => '[random (mt-rand)] '.mt_rand().$sep,
    	"8" => '[random md5(mt-rand)] '.md5(mt_rand()).$sep,
     	"9" => '[blog name] '.str_replace( array(".", " ", "-", "_") ,$sep,strtolower(get_bloginfo('name'))).$sep,
     	"A" => '[short blog name] '.str_replace( array(".","_","-"," "),"",strtolower(get_bloginfo('name'))).$sep,
    	"B" => 'wordpress style' // added this option


  2. Paolo T. (pixline)
    Plugin Author

    Posted 5 years ago #

    Thank you! I'm going to test it and include in the next update (yes, I'm going to upgrade it!)

  3. Ovidiu
    Posted 5 years ago #

    Please keep us updated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • UploadPlus : File Name Cleaner
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic