Completed the method to generate file id