I found the following link
how to handle file downlaod for selenium webdriver for safari
where it is mentioned to use the following code:
dc.setCapability("safari.options.dataDir", "your folder path");
This code needs to give the path in advance.
What should I do if I want the option to prompt the user to input the file path everytime while downloading file?
My path can change for each and every file to be downloaded.