         # verify content type (multipart)
         contentType = req.headers['content-type']
         if not (contentType? && contentType.match(/multipart/i))
-            return res.send {"ok":"0","errors":"bad content-type header, expected multipart"}   
+            return res.send {"ok":"0","errors":"bad content-type header, expected multipart"}
 
         # TODO: check if custom form options are needed e.g.
         # req.form.uploadDir = basedir + "/tmp"
 
         req.form.complete (err, fields, files) ->
             return res.send {"ok":"0","errors":err} if err? #form parsing/upload error
-                
+
             #validate data (TODO: make async when needed, currently no IO operations)
             err = []
             err = err.concat validate_crashreport_fields(fields)

            if property.path?

                #create destination filename and path
                dest_fname = fileid + "_" + property.name
                dest_path  = dest_dir + "/" + dest_fname
                #console.log "moving file: " + property.path + " to: " + dest_path #debug


            delete data[f]
        else
            err.push "missing attribute " + f

    # check optional fields
    _(OPTIONAL_FIELDS).each (f) -> delete data[f] if data[f]?

    # check for unknown fields
    _(data).each (value,fieldname) -> err.push "unknown attribute " + fieldname

    err
