Hey William,
Well, unfortunately this looks like another job for Cold Fusion. The CF server automatically parses the filename and leaves the name and extension in-tact without having to do anything to the code. I would have preferred to use WiTango, but that's too much code for an application that has a lot of file upload, and if there's an error in the communication then the video wouldn't get uploaded. Kind regards, Rick From: William Conlon [mailto:[EMAIL PROTECTED] Sent: August 30, 2007 2:08 PM To: [email protected] Subject: Re: Witango-Talk: File name in File upload Not exactly. The complete path on the uploader's system is provided (kind of a security leak I think). path1 splits this into the directory hierarchy, with the filename as the last column. The filename then gets split into a name and extension. On Aug 30, 2007, at 9:44 AM, Rick Sanders wrote: Hey William, Thanks! I take it that path1 would be the path to the file. Path2 would be the file name, and path3 would be the extension? I thought it would be a little easier than this since I have many file uploads. Kind regards, Rick From: William Conlon [mailto:[EMAIL PROTECTED] Sent: August 30, 2007 11:36 AM To: [email protected] Subject: Re: Witango-Talk: File name in File upload 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 <http://www.webenergy.ca/> www.webenergy.ca <http://www.webenergyusa.com/> www.webenergyusa.com Shop online for computer systems, accessories, and much, much more! <http://shop.webenergy.ca/> http://shop.webenergy.ca ________________________________________________________________________ TO UNSUBSCRIBE: Go to <http://www.witango.com/developer/maillist.taf> http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
