[mod_python] upload file?

John Mudd JohnMudd at mindspring.com
Fri May 7 08:14:02 EST 2004


I'm still trying to upload a file.

I reduced my mod_python code to a small example and attached it.  It
uses HTMLgen to generate the HTML.  I've listed the HTML and the trace
output below.  The name of the file I'm trying to upload is
'zopeIntro.txt'.  I'm using Apache/2.0.49 (Unix) mod_python/3.1.3
Python/2.3.

I'm hoping this will make whatever mistake I'm making easier to see. 
Any suggestions?





Here's the trace output:

--------------------------------------------------------------------------------
item.name='inputJar'
item=Field('inputJar', 'zopeIntro.txt')
item.type='text/plain'
item.type_options={}
type(item)=<type 'instance'>
item.value='zopeIntro.txt'
item.file.read()='zopeIntro.txt'
item.name='add product'
inputJar='zopeIntro.txt'
type(inputJar)=<class 'mod_python.util.StringField'>
dir(inputJar)=['__add__', '__class__', '__contains__', '__delattr__',
'__dict__', '__doc__', '__eq__', '__ge__', '__getattribute__',
'__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__',
'__init__', '__le__', '__len__', '__lt__', '__mod__', '__module__',
'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__',
'capitalize', 'center', 'count', 'decode', 'encode', 'endswith',
'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit',
'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower',
'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rstrip', 'split',
'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate',
'upper', 'value', 'zfill']





Here's the HTML.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>

<!-- This file generated using Python HTMLgen module. -->
<head>
  <meta NAME="GENERATOR" CONTENT="HTMLgen 2.2.2">
        <title>Products</title>
</head>
<body>
<img src="/image/banner.gif" height="30" width="472" alt="banner.gif" border="0"><br>
<span style="width: 60px"></span> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<h3>Products</h3>
<hr>


<form METHOD="POST" ACTION="http://mudd.homeip.net/javaSignAuto/jsa.py">

<input TYPE="file" NAME="inputJar">
<input TYPE="submit" NAME="add product" VALUE="Add Product">
</form>


<p><hr>
<span style="width: 60px"></span> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<img src="../image/blank.gif" height="19" width="71" alt="blank.gif"> 
<br><img src="/image/logo.gif" height="35" width="36" alt="logo.gif" align="bottom">
<font SIZE="-1"><p>Copyright &#169 Micky Mouse<br>All Rights Reserved<br>

Comments to author: <a HREF="mailto:&#109;ic&#107;y@&#100;is&#110;ey&#46;co&#109;">micky at disney.com</a><br>
Generated: Fri May 7, 2004 <br><hr>
</font>
</body> </html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsa.py
Type: text/x-python
Size: 1735 bytes
Desc: not available
Url : http://mailman.modpython.org/pipermail/mod_python/attachments/20040507/87444715/jsa-0001.py


More information about the Mod_python mailing list