Re: Extracting a filename
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 59979
interpreted = N
texte = I'm not sure, but you may need a javascript to populate a filename field on your form. It's been a while since I've looked at upload forms.Bill-----Original Message-----From: Gary Krockover
Sent: Wed, 10 Nov 2004 14:44:12 -0800To: "WebDNA Talk" Subject: Re: Extracting a filenameThanks Sal,That's the template that I'm working with, however the value for "thename" is gathered from the user, which is what I'm hoping to do away with - instead of having the user name the file that is being uploaded, it will just take the actual filename from what was selected. I'm guessing that it can't be done, else it would of been already. Somebody prove me wrong please. :)At 04:33 PM 11/10/2004, you wrote: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 , 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]