trying to load automatically a csv

trying to load automatically a csv

Hi !

I 'm working with database visualisation based on information edited in a csv file.
I found this exemple (below). it works like a charm, but i try to get the csv without input button.
If you have any idea with how to load it automatically :)
thank you so much.

<input type="file" name="filename" id="filename">
    <div id="csvimporthint"></div>

<script>

$("#filename").change(function(e) {
var ext = $("input#filename").val().split(".").pop().toLowerCase();

if($.inArray(ext, ["csv"]) == -1) {
alert('Upload CSV');
return false;
}
   
if (e.target.files != undefined) {
var reader = new FileReader();
reader.onload = function(e) {
var csvval=e.target.result.split("\n");
var csvvalue=csvval[0].split(",");
var inputrad="";
for(var i=0;i<csvvalue.length;i++)
{
var temp=csvvalue[i];
var inputrad=inputrad+" "+temp;
}
$("#csvimporthint").html(inputrad);
$("#csvimporthinttitle").show();
};
reader.readAsText(e.target.files.item(0));

}

return false;

});
</script>