/* $Cambridge: hermes/src/prayer/cmd/cmd_upload_exit.c,v 1.3 2008/09/16 09:59:55 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");
}
