#!/usr/bin/python
# -*- coding: utf-8 -*-

import cgi, cgitb, os, sys, time, subprocess
import json

cgitb.enable()
#cgi.test()

#result = {'success':'true','message':'The Command Completed Successfully'};

#content_len = int(os.environ["CONTENT_LENGTH"])

form = cgi.FieldStorage()
file = form['file'].value

print "Content-type:text/html\r\n\r\n"

if file == "":
    print("No File Supplied")

else:
    os.system("cd /usr/share/apache2/htdocs/preset/ && rm " + file);

    print(file + " Removed")