       if boundTest1 {
         if c == 13 {
           let ei = i - boundary.count - 3
-          if !fileNameValue.isEmpty || !contentTypeValue.isEmpty {
+          if isContentFile {
+            tempFile!.writeBytes(collectToken(ei))
             body.files[nameValue] = BodyFile(name: fileNameValue,
-                contentType: contentTypeValue, data: collectToken(ei))
+                contentType: contentTypeValue, file: tempFile!)
+            tempFile = nil
           } else {
             body.fields[nameValue] = collectString(ei)
           }

    }
  }

  mutating func inContentData() throws {
    tokenIndex = index
    entryParser = .ContentDataStarted

    entryParser = linedUpParser
  }

  // Call this to help remove the temp files.
  //
  // When BodyParser is used from a main file, outside functions, temp files
  // could persist after the program has finished running.
  mutating func close() {
    for (_, bf) in body.files {
      (bf.file as! TempFile).closeAndUnlink()
    }
  }

}


