M
mee-shell
I have a page with the file upload as the following:
<form action="UploadConfirm.psp" method="post"
enctype="multipart/form-data">
<input type="file" name="UploadFile"><br><br>
<a href="javascript:document.forms[0].submit();">submit</a><br><br>
</form>
after submit, I'd like to retrieve the file name, and I have written
something like this:
<%
import sys
import os
if form.has_key('UploadFile'):
TheFile = form['UploadFile']
filename = TheFile.filename
else:
TheFile = 'No file was uploaded, im empty'
filename = ''
%>
when I tested it, I got an error after submitting a file, and the
error message was:
AttributeError: 'StringField' object has no attribute 'filename'
Can anyone tell me what cause the problem and how I can fix it?
Thanks a lot.
<form action="UploadConfirm.psp" method="post"
enctype="multipart/form-data">
<input type="file" name="UploadFile"><br><br>
<a href="javascript:document.forms[0].submit();">submit</a><br><br>
</form>
after submit, I'd like to retrieve the file name, and I have written
something like this:
<%
import sys
import os
if form.has_key('UploadFile'):
TheFile = form['UploadFile']
filename = TheFile.filename
else:
TheFile = 'No file was uploaded, im empty'
filename = ''
%>
when I tested it, I got an error after submitting a file, and the
error message was:
AttributeError: 'StringField' object has no attribute 'filename'
Can anyone tell me what cause the problem and how I can fix it?
Thanks a lot.