Re: Extracting a filename

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59980
interpreted = N
texte = Have you looked at the upload_file.tpl and the upload_file2.tpl pages in StoreBuilder? -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Gary Krockover Sent: Wednesday, November 10, 2004 2:44 PM To: WebDNA Talk Subject: Re: Extracting a filename Thanks 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.
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 ------------------------------------------------------------- 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)
Have you looked at the upload_file.tpl and the upload_file2.tpl pages in StoreBuilder? -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Gary Krockover Sent: Wednesday, November 10, 2004 2:44 PM To: WebDNA Talk Subject: Re: Extracting a filename Thanks 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.
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 ------------------------------------------------------------- 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:

WebCatalog Mac and cgi-bin (WebSTAR 2.0) (1997) Calculating multiple shipping... (1997) File commands and Wild Cards ?? (1998) Server Freeze...not always (1998) Ampersand (1997) Queertrons? (1997) WebCat2.0 acgi vs plugin (1997) Show if time tags (1997) Re:Email Problem (1997) Merging databases (1997) [include] affect on filepaths for links? (1997) Running 2 two WebCatalog.acgi's (1996) [OT] JS Help PLEASE (2006) A quickie question (1997) trouble updating records in database (1998) Fulfillment e-mail? (1998) [math date] with non-US date format (2000) OT: javascript help (2003) Re[2]: ftp access on Macos X (2000) WebCat 4.0 (2000)