public function upload($directory, $run_filename, $code_name, $options = array())
    {
        $temp_file = tempnam(sys_get_temp_dir(), 'iron_worker_php');
        if (array_key_exists('ignored', $options)) {
            if (!is_array($options['ignored'])) {
                $options['ignored'] = [$options['ignored']];
            }
        } else {
            $options['ignored'] = [];
        }
        if (!self::zipDirectory($directory, $temp_file, true, $options['ignored'])) {
            unlink($temp_file);
            return false;
        }
        unset($options['ignored']);
        try {
            $this->postCode($run_filename, $temp_file, $code_name, $options);
        } catch (\Exception $e) {
            unlink($temp_file);
            throw $e;
        }
        return true;
    }