Re: Extracting a filename
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 59976
interpreted = N
texte = Maybe this code from the upload.tpl example will help.
[text]thename=[/text][formvariables][showif [url][name][/url]^[url]"thename"[/url]][text]thename=[value][/text][/showif][/formvariables][hideif [thename]=]Form Variables:
Index | Name |
[formvariables][index] | [name] |
[/formvariables]
Note that the form variables for a multipart/form-data form submission arevery different from standard form variables. Since you will need access toall the raw data in the form, the "name" of the form variables includes allthe mime information that is normally parsed out. Thus when you have aninput field like <name="action" value="upload">, that is in amultipart form, the name of the form variable is something like this:-Content-Disposition: form-data; name="action"- (as opposed to -action-).The value, however, shows up as -upload-.When inside a [raw][formvariables][/raw] loop, you usually would dosomething like this:[raw][showif[url][name][/url]^[url]"action"[/url]][/raw]. Thus you cannot easily access a particular form variable without looping through all of them and lookingfor the name contained in the [raw][name][/raw] parameter.
[formvariables][showif [url][name][/url]^[url]"theFile"[/url]][writefile file=[thename]&secure=F][value][/writefile][/showif][/formvariables]
see picture[/hideif]