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.
Select the file:
Name the file:


[text]thename=[/text] [formvariables] [showif [url][name][/url]^[url]"thename"[/url]] [text]thename=[value][/text] [/showif] [/formvariables] [hideif [thename]=] Form Variables:
[formvariables] [/formvariables]
IndexName
[index]
[name]

Note that the form variables for a multipart/form-data form submission are very different from standard form variables. Since you will need access to all the raw data in the form, the "name" of the form variables includes all the mime information that is normally parsed out. Thus when you have an input field like <name="action" value="upload">, that is in a multipart 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 do something 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 looking for 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] Sal D'Anna -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Gary Krockover Sent: Wednesday, November 10, 2004 2:23 PM To: WebDNA Talk Subject: Extracting a filename Can anyone think of a way to extract the filename out of this formvariables string, i.e., logo_small.gif. Noting that the filename will be a different value/length each time. 2 : Content-Disposition: form-data; name="thefile"; filename="logo_small.gif" Content-Type: image/gif ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Extracting a filename ( Brian Fries 2004)
  2. Re: Extracting a filename ( "Gary Krockover" 2004)
  3. Re: Extracting a filename ( Rob Marquardt 2004)
  4. Re: Extracting a filename ( "Sal D'Anna" 2004)
  5. Re: Extracting a filename ( devaulw@onebox.com 2004)
  6. Re: Extracting a filename ( "Gary Krockover" 2004)
  7. Re: Extracting a filename ( "Sal D'Anna" 2004)
  8. Extracting a filename ( "Gary Krockover" 2004)
Maybe this code from the upload.tpl example will help.
Select the file:
Name the file:


[text]thename=[/text] [formvariables] [showif [url][name][/url]^[url]"thename"[/url]] [text]thename=[value][/text] [/showif] [/formvariables] [hideif [thename]=] Form Variables:
[formvariables] [/formvariables]
IndexName
[index]
[name]

Note that the form variables for a multipart/form-data form submission are very different from standard form variables. Since you will need access to all the raw data in the form, the "name" of the form variables includes all the mime information that is normally parsed out. Thus when you have an input field like <name="action" value="upload">, that is in a multipart 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 do something 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 looking for 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] Sal D'Anna -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Gary Krockover Sent: Wednesday, November 10, 2004 2:23 PM To: WebDNA Talk Subject: Extracting a filename Can anyone think of a way to extract the filename out of this formvariables string, i.e., logo_small.gif. Noting that the filename will be a different value/length each time. 2 : Content-Disposition: form-data; name="thefile"; filename="logo_small.gif" Content-Type: image/gif ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Sal D'Anna"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

RE: [WebDNA] Circumnavigate Browser Timeout On Lengthy WebDNA Operations (2014) [TaxableTotal] - not working with AOL and IE (1997) Applescript, WebDNA, and PDF (1997) Show new (2003) NT considerations (1997) Multiple fields on 1 input (1997) WebCatalog 3.0.8 is on FTP... (2000) WebMerchant 1.6 and SHTML (1997) Nutscrape Doesn't Render Right (2002) SEA files (1996) Firewalls - What's Good? (1999) affiliate marketing program (1998) [WebDNA] El Capitan (2017) Exclude by date - multiple (1997) New commands in Final candidate (1997) [WebDNA] Ubuntu 16.04.4 LTS (2018) WebDNA Writer Needed (1997) WebCatalog/Mac 2.1b2 - PIXO (1997) Forcing Search w/ URL (1999) [OT] Linux -> Winderz (2005)