I have used the same code which you have shared above. However, the same issue is coming "File is mandatory".