how to upload file into server directory.. if my project at D:\\myapp and i run with cmd d:\\myapp grails run-app when i run this app and other Computer run it and upload fi
The destination is only a file like in Java.
def f = request.getFile('some_file')
//validate file or do something crazy hehehe
//now transfer file
File fileDest = new File("Path to some destination and file name")
f.transferTo(fileDest)
OR if you want to store it at some path relative to user home:
def homeDir = new File(System.getProperty("user.home")) //user home e.g /home/username for unix
File fileDest = new File(homeDir,"path/to/some_folder")
f.transferTo(fileDest)
UPDATE
As per why your getFile is not working, you are not submitting your form:
Should be:
if you need to use javascript you should submit the form instead of adding a link to another page.