Your file upload button will look like this:
<input class="button" type="submit" name="Submit" value="Add File"
onclick="this.form.path.value=this.form.File.value;" />
Then you can parse <@POSTARG NAME="Submit">. I pass the file and
file path to a method for this:
<@ASSIGN SCOPE="method" name="size" VALUE="<@LENGTH STR='@@method
$file'>">
<@IFEMPTY VALUE="@@method$filename">
<@ASSIGN SCOPE="method" NAME="path1" value="<@TOKENIZE
VALUE='@@method$path' CHARS='\:/'>">
<@ASSIGN SCOPE="method" NAME="path2" value="@@method$path1
[1,<@numcols array='@@method$path1'>]">
<@ASSIGN SCOPE="method" NAME="path3" value="<@TOKENIZE
VALUE='@@method$path2' CHARS='.'>">
<@ELSE>
<@ASSIGN SCOPE="method" NAME="path3" value="<@TOKENIZE
VALUE='@@method$filename' CHARS='.'>">
</@IF>
<@ASSIGN SCOPE="method" NAME="fileextn" value=".@@method$path3[1,2]">
<@ASSIGN SCOPE="method" NAME="filename" value="@@method$path3
[1,1].@@method$path3[1,2]">
On Aug 30, 2007, at 6:46 AM, Rick Sanders wrote:
Hey List,
Haven’t done this before in WiTango. When someone is uploading a
file through a form, how can you grab the file name and extension?
I can figure out how to check the file size, but I need to grab the
file name and extension. Anyone else ever do this?
Thanks in advance!
<image001.jpg>
Rick Sanders
President
902-401-7689
www.webenergy.ca
www.webenergyusa.com
Shop online for computer systems, accessories, and much, much more!
http://shop.webenergy.ca
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf