javascript – Change filename on input type file jquery

I need to change the filename of my input type file and add timestamp before sending it to my php function, this is my current code.

var currentTime = new Date();

$('#select_file').click(function() {
    $('#image_file').show();
    $('.btn').prop('disabled', false);
    $('#image_file').change(function() {
        var filename = $('#image_file').val();
        $('#select_file').html(currentTime +filename);
    });
});​

Product of the Month September 2016

Source link

Leave a Comment

Your email address will not be published. Required fields are marked *