Xupload Loop

I am trying to use xupload to upload files and insert data ,

I need to insert one row for every file in the upload, and the file name should be the last row id+1;

but i cant find how(where) to do this increment !

,

Thank you