savePolygonFile "Unsupported file type" fix

users could get error "Unsupported file type" in savePolygonFile
fix for #416