func extractUploads(payload *APIParams) (uploads []*FileUpload) {
	for k, v := range *payload {
		if mpart, ok := v.(*FileUpload); ok {
			uploads = append(uploads, mpart)
			delete(*payload, k)
		} else if child_params, ok := v.(APIParams); ok {
			child_uploads := extractUploads(&child_params)
			uploads = append(uploads, child_uploads...)
		}
	}
	return uploads
}
func extractUploads(payload *APIParams) (uploads []*FileUpload) {
	for k, v := range *payload {
		if mpart, ok := v.(*FileUpload); ok {
			uploads = append(uploads, mpart)
			delete(*payload, k)
		} else if child_params, ok := v.(APIParams); ok {
			child_uploads := extractUploads(&child_params)
			uploads = append(uploads, child_uploads...)
		}
	}
	return uploads
}
// This will take a hash (or multi-level hash) of APIParams and extract
// out all the multipart file uploads and put them in an array. The recursion
// is needed as CM API 1.5 and SS both use this, but SS has all its params
// on the top level while CM API 1.5 has the resource name on the top level
// with the params being one level down the tree.