need to add custom field in more products

This code will allow you to display the upload form when the product is in the $special_category product category.

add_action( 'woocommerce_before_add_to_cart_form', 'display_additional_product_fields', 9 );
function display_additional_product_fields() {
    global $product;

    // Product category or slug that will allow the upload field to be displayed.
    $special_category = 314;

    if ( ! has_term( $special_category, 'product_cat', $product->ID ) ) {
        return;
    }
    ?>
<p class="form-row validate-required" id="image" >
    <label for="file_field"><?php esc_html_e( 'Upload Image:', 'text-domain' ); ?>
        <input type="file" name="image" accept="image/*">
    </label>
</p>
<?php
}