Function to generate a file of a given size in MB