Hi,
Yes, it is possible. You can add the post ID to the custom upload dir when registering the file
field. For example:
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
function your_prefix_function_name( $meta_boxes ) {
$post_id = null;
if ( isset( $_GET['post'] ) ) {
$post_id = intval( $_GET['post'] );
} elseif ( isset( $_POST['post_ID'] ) ) {
$post_id = intval( $_POST['post_ID'] );
}
$meta_boxes[] = [
'title' => __( 'Post Meta', 'your-text-domain' ),
'id' => 'post-meta',
'fields' => [
[
'name' => __( 'File', 'your-text-domain' ),
'id' => 'file',
'type' => 'file',
'upload_dir' => WP_CONTENT_DIR . '/' . $post_id . '/invoices/',
],
],
];
return $meta_boxes;
}