I found the problem.The import xml format is wrong.
If anyone else comes to this thread seeking assistance on "Could not write attachment" based errors during project import I'd like to direct you to the following:
"Could Not Write Attachments" When Importing a Project with P6 Web Services (Doc ID 1583494.1)
The error most often occurs when Message Transmission Optimization Mechanism (MTOM) is not being used when importing a file using P6 Web Services. Both Import and Export services require MTOM. If not using MTOM the XML import file is not formatted correctly in the request message and Web Services cannot create the temporary import file on the server resulting in a java.io.FileNotFoundException exception. When exporting no error is thrown but no file is created.
The solution is to activate MTOM support either programatically or through the use of configuration.