You do not "upload a file to a path". File upload works by a mechanism where the client-side file is opened by the client application (browser) and its data is MIME-encoded and copied into the request data stream that is sent to the server.
Once the server recieves that request, the file data is parsed out of it, but that doesn't make it a "file". The server can hold the data anywhere it wants to, including in memory.
The file upload API allows you to take that data and - using your own code - process it. You can simply read it and do computations or whatever, you can copy it into a BLOB in a database, or you can create a file on the server's filesystem and write the data returned from the file API into it. Which is what you appear to wish to happen.
The "not a directory" problem is most likely that you are setting a relative path rather than an absolute path and you are appending an (assumed) "absolute" path to that relative path.
Relative paths are dangerous in web applications, because a relative path is relative to the current working directory and there is no such thing in
J2EE. If you use the general working directory mechanisms in a J2EE application, the results are unpredictable.
An absolute path should ALWAYS start with a "/". Even in Windows, it's recommended that you code paths in the format "/C:/directory1/directory2/myfile.dat". In Unix/Linux, there's no other way for the pathname parser to properly interpret an absolute path if it doesn't begin with a slash.