I am trying to refer to a location on my computer, however Java is telling me that I have the wrong syntax.
Is this line correct?
File newlyUploadedFile = new File(“D:\\” + fileName);
The thing is the file gets uploaded correctly to the location I want it to go to, but I get the error:
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
Escape your backslashes in java strings, always.
The IOException is caused by the system not finding the file you specified in filename. Try adding
and see what it returns. If your path returns false then you have a mistake in filename.