'file upload field on checkout page woocommerce

I want to add a file upload field on checkout page in woocommerce.I have added it but when I click on "Place order" button and try to check post values,$_FILES array is empty while other fields on the same page ,same form are coming with respective values.I am using response using print_r().This issue also had been asked in below thread and explained well.I have exactly same problem as in this thread.

How to upload a image in woocommerce checkout page and link it to the order

Any help highly appreciated.



Solution 1:[1]

You can always use the product add ons plugin from woo. http://www.woothemes.com/products/product-add-ons/

I have used it quite a lot. If there is no shortcode option to place the upload field on checkout, I am sure you can take that function and add it to the checkout.php.

Its simple to add uploads to any product and this gets added to the order on checkout.

Hope that helps.

Solution 2:[2]

//This code paste on funtion.php  
//For upload image

add_filter( 'woocommerce_shipping_fields', 
'woo_filter_upload_shipping'        );

function woo_filter_upload_shipping( $address_fields ) { 
//  $address_fields['file_upload']['required'] = true;

$address_fields['file_upload'] = array(
//'label'     => __('Upload your ID', 'woocommerce'),
'required'  => false,
'class'     => array('form-row-wide'),
'clear'     => true
);

 return $address_fields;
 }

 //Using this function to show Upload field on your checkout page.

 function add_file_field(){

 $uploadFile   = "";
 $uploadFile   .='<div id="upload_CNIC_image">';
 $uploadFile .='<input id="file_upload" name="file_upload"
 type="file"    multiple="true">';
 $uploadFile .='<span id="">';
 $uploadFile .='</span>';
 $uploadFile .='</div>';
 echo $uploadFile;
 }
 add_action('woocommerce_after_order_notes','add_file_field');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Balerdio
Solution 2 Rahul Rawat