Ok, 2nd correction. sorry. The error was not with the multipart, and not with the regular expression. It is in the line: list = th["attachments"].to_s.split(",") It is splitting the lines based on the presence of commas. My filename contains a comma... Thierry