Need help with reading contents of attachment

I have a requirement to read a csv file which is attached to an automated email sent to us by a courier company.

So far my script can recieve the email messages into servoy and save the attachment byte data into a variable.

var attachment = vAttach[j];
var attachName = attachment.getName();
var attachmentDataByteArray = attachment.getData();

What I then need to do is read this file and import the contents into some database fields.
Do I need to write the file to a temp location on the client PC and then read it? Or is there a more elegant way?

Version 3.1.6-build 410
Java version 1.5.0_10-b03 (Windows XP)
MySQL 5

Dexadrine:
What I then need to do is read this file and import the contents into some database fields.

You have specified that the attached file is a csv file. So, you can read the contents by using the readTextFile() form the file Plugin and stored in the backend accordingly.