SingleUpload.py

Category: Python - Miscellaneous

Usage:

#!/usr/bin/env python2.5
#
# html file:
# <form action="test.cgi" method="POST" enctype="multipart/form-data">
# <input name="file1" type="file"><input type="submit"></form>

# test.cgi: ...

import SingleUpload

def upload():
fr = SingleUpload.open()
fw = open('/tmp/%s' %fr.filename, 'wb')

while True:
l = fr.read(65536)
if not l:
break

fw.write(l)
fw.flush()
fw.close()

print 'Content-Type: text/plain\r\n\r\n'
try:
upload()
print 'OK'
except IOError:
__import__('traceback').print_exc(
file=__import__('sys').stdout ) Date: 20 February, 2012


Cgi

Homepage: http://code.activestate.com/recipes/521897-singleuploadpy/?in=lang-python

Developer: Wilhelm Shen

License: Python License

Operating System: Windows

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Cheaper Prices.

developer Developer: JJ Larkin
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


Apache Easy Debug is multi-platform compatible.

developer Developer: Softcomplex Inc.
license License: Freeware
operating systems Operating System: Unix/Linux/Windows


Site builder, content site management system in Perl.

developer Developer: On Elpeleg
license License: GNU General Public License (GPL)
operating systems Operating System: Unix, Win, Linux


CGI script where fortune cookie meets wiki: an editable quote of the day, a way to remember people to e-mail, and other things as well.

developer Developer: Jonathan Hayward
license License: Perl License
operating systems Operating System: Unix/Linux


It can be used as a tutorial guide for beginners or a reference book for experienced developers.

developer Developer: mark
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


Perl which stands for Practical Extraction and Report Language, is an interpreted high-level programming language developed by Larry Wall.

developer Developer: savitha
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


Open Source Blog Software MegaMix 1.

developer Developer: open source blog
license License: Freeware
operating systems Operating System: Unix/Linux/Windows


The built-in xrange is fast, but it does not support floats and longs as start,stop,step parameters.

developer Developer: Eyal Lotem
license License: Python License
operating systems Operating System: Windows


Proxies are usually implemented as objects that forward method calls to a
"target" object.

developer Developer: Martin Blais
license License: Python License
operating systems Operating System: Windows