The problem is still that you have two forms on the page. You cannot submit both of these forms, you can only submit one.
Due to this you will only ever get the add to cart to function or the upload but not both.
To make this work you will need to add the file field from the form that starts at line 187 to the add to cart form that starts on line 198. Once you do that you will then need to update the update server behavior to be triggered on the add to cart button being pressed.