Re: Multipart Form - Ascertain File Type

This WebDNA talk-list message is from

2007


It keeps the original formatting.
numero = 68740
interpreted = N
texte = If you have the default install of WebDNA on your server, take a look at the file /admin/upload_multiphotos2.tpl It shows you how to distinguish between a .jpg and a .gif file. I've used that basic file to figure out the file extensions. However be aware that just because the file says it's a .txt does not actually mean it IS a txt. For image validation I sometimes run the .gif or .jpg through ImageMagic. If a real image is created then it was an image file. But if this is an open form for all web visitor you will have to test the validity somehow. If this is for your customers, well, you *should* be able to trust them, right? -- Matthew A Perosi Psi Prime, Inc. http://www.psiprime.com 323 Union Blvd. Totowa, NJ 07512 P: 973.225.9870 F: 973.413.8217 Tana Adams wrote: >Hi, > >I was wondering if anyone knew how to ascertain what type of file was being >uploaded when using a multipart form. I'm trying to create a file upload >that will only allow a .txt file to be uploaded. I've tried to ascertain >the file type coming in using the formvariables context but it doesn't seem >to work. The form works fine...files uploading without problem. Does >anyone have any ideas? > >Thank you, > >Tana > > >------------------------------------------------------------- >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: Multipart Form - Ascertain File Type ( "Olin Lagon" 2007)
  2. Re: Multipart Form - Ascertain File Type ( Donovan Brooke 2007)
  3. Re: Multipart Form - Ascertain File Type ( "Tana Adams" 2007)
  4. Re: Multipart Form - Ascertain File Type ( Matthew A Perosi 2007)
  5. Re: Multipart Form - Ascertain File Type ( Gary Krockover 2007)
  6. Re: Multipart Form - Ascertain File Type ( John Peacock 2007)
  7. Multipart Form - Ascertain File Type ( "Tana Adams" 2007)
If you have the default install of WebDNA on your server, take a look at the file /admin/upload_multiphotos2.tpl It shows you how to distinguish between a .jpg and a .gif file. I've used that basic file to figure out the file extensions. However be aware that just because the file says it's a .txt does not actually mean it IS a txt. For image validation I sometimes run the .gif or .jpg through ImageMagic. If a real image is created then it was an image file. But if this is an open form for all web visitor you will have to test the validity somehow. If this is for your customers, well, you *should* be able to trust them, right? -- Matthew A Perosi Psi Prime, Inc. http://www.psiprime.com 323 Union Blvd. Totowa, NJ 07512 P: 973.225.9870 F: 973.413.8217 Tana Adams wrote: >Hi, > >I was wondering if anyone knew how to ascertain what type of file was being >uploaded when using a multipart form. I'm trying to create a file upload >that will only allow a .txt file to be uploaded. I've tried to ascertain >the file type coming in using the formvariables context but it doesn't seem >to work. The form works fine...files uploading without problem. Does >anyone have any ideas? > >Thank you, > >Tana > > >------------------------------------------------------------- >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/ Matthew A Perosi

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 4 Install Problems (2000) $flushcache causes crash (2000) WebCat2 - [include] tags (1997) Practice runs ? (1997) Summary search -- speed (1997) [OT] Moving to Wisconsin (2002) Associative lookup style? (1997) Help formatting search results w/ table (1997) New Command prefs ... (1997) [showif] based on data from [tcpconnect][tcpsend]? (2000) Aaron kant add (or whatever it was) (2000) For those of you not on the WebCatalog Beta... (1997) Re:2nd WebCatalog2 Feature Request (1996) is 'template' a reserved webcat tag? (2000) Adding Multiple Items to Shopping Cart from a Results page (1997) Correlating the record found with the fieldname (2000) Summary search -- speed (1997) PhotoMill -> PhotoMaster (1997) This list needs a digest: rant, rave... (1997) WebCat2.0 [format thousands .0f] no go (1997)