Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Custom Upload Field (Hubspot)

Custom Upload Field (Hubspot)

/*Replace HubSpots upload file input field*/
jQuery(window).load(function() {
   jQuery( '<div class="custom-upload-button"><span>Upload File</span><span class="uploadfilename"></span></div>' ).insertAfter('.hbspt-form [type="file"]');
});

/*FileName of the uploaded file*/
jQuery(function($){
   $('input[type="file"].hs-input').on('change', function(e){
        var fileName = e.target.files[0].name;
        $(this).next('.custom-upload-button').find('.uploadfilename').text( fileName );
   }); 
});