       boundTest2 = false
       if boundTest1 {
         if c == 13 {
-          body.fields[nameValue] = collectString(i - boundary.count - 3)
+          let ei = i - boundary.count - 3
+          if !fileNameValue.isEmpty || !contentTypeValue.isEmpty {
+            body.files[nameValue] = BodyFile(name: fileNameValue,
+                contentType: contentTypeValue, data: collectToken(ei))
+          } else {
+            body.fields[nameValue] = collectString(ei)
+          }
           entryParser = .LineFeed
           linedUpParser = .ContentDisposition
           index = i + 1

    repeat {
      let c = stream[i]
      if boundTest3 && c == 13 {
        body.fields[nameValue] = collectString(i - boundary.count - 5)
        index = length // Body exit.
        done = true
        break


public struct BodyFile {

  public var name = ""
  public var contentType = ""
  public var data: [UInt8]

}

