                             # TODO: cleanup?
                             return
                         res.send {"ok":"1","url":"http://#{DOMAIN_NAME}/crashreports/" + crashreport.id}
-                
+
 exports.init_import_api = init_import_api
 

            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


            err.push "invalid file " + fileid + ": missing one of mandatory fields (name,path,type)"
            delete data[fileid]

    # check mandatory files
    _(MANDATORY_FILES).each (f) ->
        if data[f]?
            err = err.concat validate_file data[f], f
            delete data[f]
        else
            err.push "missing attribute " + f

    # check optional files (attachments)
    _(data).each (property,fileid) -> delete data[fileid] if fileid.match /attachment\.\d+/i
