Try using getAbsolutePath() instead of getName(). getName() returns the name of the file only eg no path information to the file
Type: Posts; User: copeg
Try using getAbsolutePath() instead of getName(). getName() returns the name of the file only eg no path information to the file