ci riprovo....

codice:
//SALVO ALLEGATI
 if (item.Attachments.Count > 0)
	 {
		for (int x = 1; x <= item.Attachments.Count; x++)
 		{
			string retrive_type = item.Attachments[x].FileName.ToString();
			string type = retrive_type.Substring(retrive_type.Length - 3);
			string CONTENT_TYPE = "";

				switch (type)
                                	{
                                         case "doc":
                                         CONTENT_TYPE = "application/msword; name=" + item.Attachments[x].FileName.ToString();
                                         break;

                                         case "xls":
                                         CONTENT_TYPE = "application/vnd.ms-excel; name=" + item.Attachments[x].FileName.ToString();
                                         break;

                                         case "lsx":
                                         CONTENT_TYPE = "application/vnd.ms-excel; name=" + item.Attachments[x].FileName.ToString();
                                         break;

                                         case "pdf":
                                         CONTENT_TYPE = "application/octet-stream; name=" + item.Attachments[x].FileName.ToString();
                                         break;

                                         case "gif":
                                         CONTENT_TYPE = "application/gif; name=" + item.Attachments[x].FileName.ToString();
                                         break;

                                        case "png":
                                        CONTENT_TYPE = "application/octet-stream; name=" + item.Attachments[x].FileName.ToString();
                                        break;

                                        case "rar":
                                        CONTENT_TYPE = "application/octet-stream; name=" + item.Attachments[i].FileName.ToString();
                                        break;

                                        case "zip":
                                        CONTENT_TYPE = "application/octet-stream; name=" + item.Attachments[x].FileName.ToString();
                                        break;

                                        default:
                                        CONTENT_TYPE = "application/octet-stream; name=" + item.Attachments[x].FileName.ToString();
                                        break;
                                                
                                        }                                               
                                        
                                        FILENAME = item.Attachments[x].FileName.ToString();
                                        CONTENT_SIZE = item.Attachments[x].Size.ToString();

                                        //Salvo il file su FS
                                        item.Attachments[x].SaveAsFile("C:\\ecc ecc\\Visual Studio 2010\\Projects\\MailReader\\" + FILENAME);
                                        //

                                        FileStream fs = new FileStream("C:\\ecc ecc\\Visual Studio 2010\\Projects\\MailReader\\" + FILENAME, FileMode.Open, FileAccess.Read);
                                        BinaryReader br = new BinaryReader(fs);
                                        Byte[] bytes = br.ReadBytes((Int32)fs.Length);
                                        br.Close();
                                        fs.Close();
                                        
                                                
                                                //INSERIMENTO ARTICLE_ATTACHMENT 

                                        MySqlDataReader reader_att_id;
                                        int article_id = 0;

                                        SQLQuery_att_id = "SELECT MAX(ID) AS ID FROM `otrs`.`article`";
                                        db.Execute_Query(SQLQuery_att_id);
                                        reader_att_id = db.Execute_Reader(SQLQuery_att_id);

                                        while (reader_att_id.Read())
                                        {
                                             article_id = int.Parse(string.Format("{0}", reader_att_id["ID"]));
                                        }

                                        SQLQuery = " INSERT INTO `otrs`.`article_attachment` (ARTICLE_ID, FILENAME, CONTENT_SIZE, CONTENT_TYPE, CONTENT_ID, CONTENT_ALTERNATIVE,  CONTENT, CREATE_TIME, " +
  "CREATE_BY, CHANGE_TIME, CHANGE_BY) VALUES (" + article_id + ", '" + FILENAME + "', '" + CONTENT_SIZE + "', '" + CONTENT_TYPE                                                      + "',NULL , NULL ,'" + bytes + "', now(), 0, now(), 0);";

                                        if (!db.Execute_Query(SQLQuery)) 
						throw new System.Exception("Si è verificato un errore durante il salvataggio del ticket.");
                                            }
}