This is pulled from the Option Tree theme and demonstrates how to save the upload option type as an attachment ID. Which is by adding a class of ot-upload-attachment-id
to the array.
array(
'id' => 'demo_upload_attachment_id',
'label' => __( 'Upload Attachment ID', 'option-tree-theme' ),
'desc' => sprintf( __( 'The Upload option type can also be saved as an attachment ID by adding %s to the class attribute.', 'option-tree-theme' ), '<code>ot-upload-attachment-id</code>' ),
'std' => '',
'type' => 'upload',
'section' => 'option_types',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step'=> '',
'class' => 'ot-upload-attachment-id',
'condition' => '',
'operator' => 'and'
)