Please visit underneath the filter I'm using to alter the upload directory for my custom publish-type.

My custom publish-type title is 'download'

My new directory for uploads during my custom publish-type 'download' has become... wordpress-content/downloads/

The issue is by doing this, is the fact that I my image pictures are missing since the attachment meta information is searching for the thumbnail within the original directory wordpress-content/uploads/.

How do i adjust my filter or repair the problem therefore the attachment data with this custom publish-type just uses the brand new directory wordpress-content/downloads/

Thanks is advance for just about any advice or help.

Josh

add_filter( 'upload_dir', 'my_custom_upload_dir' );
function my_custom_upload_dir( $default_dir ) {

    if ( ! isset( $_POST['post_id'] ) || $_POST['post_id'] < 0 )
    return $default_dir;
    if ( get_post_type( $_POST['post_id'] ) != 'download' )
    return $default_dir;

    $dir = WP_CONTENT_DIR . '/downloads';
    $url = WP_CONTENT_URL . '/downloads';

    $bdir = $dir;
    $burl = $url;
    $subdir = '';

    if ( get_option( 'uploads_use_yearmonth_folders' ) ) {

        $time = current_time( 'mysql' );
        $y = substr( $time, 0, 4 );
        $m = substr( $time, 5, 2 );
        $subdir = "/$y/$m";

    }   

    $dir .= $subdir;
    $url .= $subdir;

    $custom_dir = array( 

        'path'    => $dir,
        'url'     => $url, 
        'subdir'  => $subdir, 
        'basedir' => $bdir, 
        'baseurl' => $burl,
        'error'   => false, 

    );

    return $custom_dir;

}

you can make custom posttype templates, as well as in individuals code custom get attachmentfunctions.
http://codex.wordpress.org/Post_Type_Templates

this practice code could search for the publish_meta key: _wordpress_attached_file.

<?php $attachment_file = get_post_meta($current_post_id, '_wp_attached_file', false); ?>

http://codex.wordpress.org/Function_Reference/get_post_meta