Create a temporary filename that don't have any '.' inside a part
    from the suffix.

def safe_mkstemp(suffix, prefix='filedownloadutils_'):
    """Create a temporary filename that don't have any '.' inside a part
    from the suffix."""
    tmpfd, tmppath = tempfile.mkstemp(
        suffix=suffix,
        prefix=prefix,
        dir=current_app.config['CFG_TMPSHAREDDIR']
    )
    # Close the file and leave the responsability to the client code to
    # correctly open/close it.
    os.close(tmpfd)

    if '.' not in suffix:
        # Just in case format is empty
        return tmppath
    while '.' in os.path.basename(tmppath)[:-len(suffix)]:
        os.remove(tmppath)
        tmpfd, tmppath = tempfile.mkstemp(
            suffix=suffix,
            prefix=prefix,
            dir=current_app.config['CFG_TMPSHAREDDIR']
        )
        os.close(tmpfd)
    return tmppath