import tempfile
import base64


def write_payload(payload):
    """Write a base64 payload on temp file

    Args:
        payload (string): payload in base64

    Return:
        Path of file
    """

    temp = tempfile.mkstemp()[1]

    with open(temp, 'wb') as f:
        payload = base64.b64decode(payload)
        f.write(payload)

    return temp