Skip to content

Instantly share code, notes, and snippets.

View gvhung's full-sized avatar

Hung Giang Van gvhung

  • Add-On Development
  • Hanoi, Vietnam
  • 16:44 (UTC +07:00)
View GitHub Profile
#!/usr/bin/env python
import cgi, os
import cgitb; cgitb.enable()
form = cgi.FieldStorage()
if form.has_key("file"):
fileitem = form['file']
if fileitem.filename:
fn = os.path.basename(fileitem.filename)
fn = fn.replace(' ','_')