Re: Extracting a filename

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59977
interpreted = N
texte = 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/ 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)
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/ "Gary Krockover"

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:

SQLResult chokes on null values? (2006) Re:Realtime Transaction Processing (1999) OT Weird Messenger Service message (2002) What am I missing (1997) Browser frames and URLs in the Location field (2004) Databases going to sleep (1998) Couple of questions (1999) date range (1998) AJAX with WebDNA (2006) Bug Report, maybe (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) The Form authentication trick (2000) Last digit of Credit Card Stripped (1997) [thisurl] or another way (2000) Great product and great job ! (1997) wierd crashes for multi-sendmails on NT (1997) WebCommerce: Folder organization ? (1997) Error: Too many nested [xxx] contexts (1997) Again: tcpconnect problem with authorize.net (2003) DB Emergency (2002)