/* $Cambridge: hermes/src/prayer/cmd/cmd_upload_exit.c,v 1.2 2008/05/19 15:55:54 dpc22 Exp $ */
/************************************************
 *    Prayer - a Webmail Interface              *
 ************************************************/

/* Copyright (c) University of Cambridge 2000 - 2008 */
/* See the file NOTICE for conditions of use and distribution. */

#include "prayer_session.h"

void cmd_upload_exit(struct session *session)
{
    struct request *request = session->request;

    if (session->upload_file) {
        unlink(session->upload_file);
        string_free((void **) &session->upload_file);
    }

    if (session->upload_name)
        string_free((void **) &session->upload_name);

    session_message(session, "Folder Upload Cancelled");
    session_redirect(session, request, "transfer");
}
