WordPress.org

Ready to get started?Download WordPress

Forums

Frontend Uploader
[resolved] Uploaded photos going into wrong folder (13 posts)

  1. edpgm
    Member
    Posted 1 year ago #

    When using the Frontend Uploader, I noticed that for the last couple of days the photos, once approved, go into the upload folder 2012/12 even though it is 2013 and should be going into 2013/03. When I upload directly with Media Library, they do go into the correct folder 2013/03. So it appears to be a Frontend Uploader issue. Any suggestions? I tried uninstalling and reinstalling the plugin, same problem

    http://wordpress.org/extend/plugins/frontend-uploader/

  2. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Can you post the steps to reproduce and also more details about your setup (wp version, hosting, etc)

  3. edpgm
    Member
    Posted 1 year ago #

    WordPress 3.5.1 being hosted on Bluehost. The directories 2013/01 02 03 have all been created, but anything I upload in the last couple of days with the Frontend Uploader goes into 2012/12 (wp-content/uploads/) I was wondering if anyone else had encountered this problem. I don't seem to be having a date issue with any other aspect of the site. The plugin was installed from within WP.

  4. edpgm
    Member
    Posted 1 year ago #

    Just upgraded to version .4 of the plugin. Same thing, upload through the plugin, the photo goes into 2012/12, upload through media library, photo goes into 2013/03.

  5. edpgm
    Member
    Posted 1 year ago #

    Further to the above, I am using the current version of the Suffusion WP theme and the photos continue to go into 2012/12. Also, I discovered that whatever is entered into the author field is overridden by the user's logon id and whatever is entered into the credit field does not seem to be carried over to any field at all.

  6. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Hey can you try to disable the plugin and see if media still goes to the wrong folder?

  7. edpgm
    Member
    Posted 1 year ago #

    If I don't use the uploader, if I just use the Media library uploader, all uploads go into the correct 2013/03 folder.

  8. edpgm
    Member
    Posted 1 year ago #

    On a different wp site on the same server, using a different theme, I am contributing photos on 2013/04/02 but the photos are ending up in 2013/03

  9. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    Thanks. I was able to track it down. Apparently it's an issue that was introduced with WP 3.5. I tracked it down to an underlying WP core API methods. I will fix it soon-ish :)

  10. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, so I investigated a bit further. It appears to be that WordPress' core upload functions set upload folder based on a post that it's attached to.

    E.g.: You've created your post that holds Frontend Uploader shortcode in Dec 2012. Hence all the attachments get uploaded to 2012/12.

    There's a workaround for it, but it's kinda obtrusive and might lead to unexpected consequences. If it's really important for you, here's a snippet that'll take care of your issue.

    add_filter( 'upload_dir', 'my_filter_upload_dir' );
    function my_filter_upload_dir( $upload_dir ) {
    			// Keep the original year/month
    			$old_subdir = $upload_dir['subdir'];
    
    			// Generate the yearly and monthly dirs
    			$time = current_time( 'mysql' );
    			$y = substr( $time, 0, 4 );
    			$m = substr( $time, 5, 2 );
    			$new_subdir = "/$y/$m";
    
    			// Replace the old year and month to the current ones on upload
    			foreach( $upload_dir as $index => $dir ) {
    				if ( !is_bool( $dir ) )
    					$upload_dir[$index] = str_replace( $old_subdir, $new_subdir, $dir );
    			}
    
    		return $upload_dir;
    	}
  11. edpgm
    Member
    Posted 1 year ago #

    Thanks so much for tracking this down. As long as I understand what's happening I can work with it. Great support!

    Also, any way to drop the credit field, since information entered there does not seem to go anywhere?

  12. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Regarding the credit, it's a known issue, there's no way to remove the field currently. The underlying issue is the top priority for the next version.

    Marking as resolved since original question was resolved

  13. edpgm
    Member
    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic