Re: Upload Maximum
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 49523
interpreted = N
texte = Thanks Matt! I'm gonna check it out!It will be running on a Mac OSX and classic.On 4/15/03 1:54 PM, Matthew A Perosi
wrote:> I have this code direct from a page that limits the upload size of an> image to 50K.> I know I did not write this all by myself, I think the majority of the> code came from> the storbuilder or from the basic admin templates.> > You can see toward the end there is a statement like this:> [fileinfo file=..[TargetPathNameExt]]> [showif [size]>50000] ........> > You should be able to follow the code, I'm giving you a good chunk of my> template here.> > Matthew A Perosi> nj-singles.com> ijo.com> > > > > ---------------code starts here-----------------------------> > > [!]=====================================================================[/!]> [!] Get target path info [/!]> [!]=====================================================================[/!]> > [Text]TargetPath=[lookup> db=admin/prefs.db&value=QUEEN_GRAPHIC_PATH&lookInField=PREF&returnField=value]> [sku]/hold/[/Text]> > > > [!]=====================================================================[/!]> [!] retrieve information from the incomming form [/!]> [!]=====================================================================[/!]> > [formvariables]> > [showif [url][name][/url]^[url]pic[/url]]> [text]whichpic=[value][/text]> [/showif]> > [showif [url][name][/url]^[url]theFile[/url]]> [showif [url][name][/url]^[url]filename=[/url]]> [text]sourceSpecified=No[/text]> [/showif]> [hideif [url][name][/url]^[url]filename=[/url]]> [text]sourceSpecified=Yes[/text]> [/hideif]> > > [Text]temp=[Middle StartAfter=filename=][name][/Middle][/Text]> [Text]SourcePathNameExt=[Middle> StartAfter=&EndBefore=][temp][/Middle][/Text]> [ListWords Words=[SourcePathNameExt]&Delimiters=/\]> [Text]SourceNameExt=[word][/Text]> [/ListWords]> > > [text]sourceValid=No[/text]> [showif [url][name][/url]^[url].png[/url]]> [text]TargetExt=png[/text]> [text]sourceValid=Yes[/text]> [text]TargetNameExt=[SourceNameExt][/text]> [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text]> [/showif]> [showif [url][name][/url]^[url].jpg[/url]]> [text]TargetExt=jpg[/text]> [text]sourceValid=Yes[/text]> [text]TargetNameExt=[SourceNameExt][/text]> [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text]> [/showif]> > [/showif]> [/formvariables]> > > [!]=====================================================================[/!]> [!] parse info for use in the createthumbnail.pl script [/!]> [!]=====================================================================[/!]> [text]filenamelen=[CountChars][TargetNameExt][/CountChars][/text]> [text]filelen=[math][filenamelen]-4[/math][/text]> [text]extstart=[math][filenamelen]-2[/math][/text]> [text]file=[getchars> start=1&end=[filelen]][TargetNameExt][/getchars][/text]> [text]ext=[getchars> start=[extstart]&end=[filenamelen]][TargetNameExt][/getchars][/text]> > > > [!]=====================================================================[/!]> [!] Everything is correct -- continue [/!]> [!]=====================================================================[/!]> > [showif [sourceSpecified]=Yes]> [showif [sourceValid]=Yes]> > [showif [TargetPathNameExt]!]> [formvariables]> [showif [url][name][/url]^[url]theFile[/url]]> [writefile file=..[TargetPathNameExt]&secure=F][value][/writefile]> [/showif]> [/formvariables]> > [fileinfo file=..[TargetPathNameExt]]> [showif [size]>50000]> [text]imagesize=[size][/text]> [text]error=1[/text]> [text]message1=
The following errors> occured...
[/text]> [text]message3=Your file must be less than> 50K.
[/text]> [/showif]> [/fileinfo]> > [showif [error]=1]> [deletefile file=..[TargetPathNameExt]]> [/showif]> > > ---------------code ends here-----------------------------> > > > > Daniel Schutzsmith wrote:> >> Aside from the lovely, spirited discussion about privacy and consumer>> relations I would like to actually ask something relevant to this list.>> >> Has anyone devised a way to allow only a maximum amount for an upload? I>> want to restrict the user from uploading anything larger than 3MB. Has>> anyone made this possible.>> >> Alternative methods are also encouraged as I am looking for any good>> solution with WebDNA or a combination of other languages.>> >> Thanks>> >> ~dan>> >> >> ----------------------------->> Daniel Schutzsmith>> Senior Web Developer>> Berlin Productions, Inc.>> dan@berlinprod.com>> http://www.berlinprod.com>> (914) 683-5759>> (914) 683-5751 fax>> ----------------------------->> >> >> >> >> ------------------------------------------------------------->> 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/-----------------------------Daniel Schutzsmith Senior Web DeveloperBerlin Productions, Inc.dan@berlinprod.comhttp://www.berlinprod.com(914) 683-5759(914) 683-5751 fax------------------------------------------------------------------------------------------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:
Thanks Matt! I'm gonna check it out!It will be running on a Mac OSX and classic.On 4/15/03 1:54 PM, Matthew A Perosi wrote:> I have this code direct from a page that limits the upload size of an> image to 50K.> I know I did not write this all by myself, I think the majority of the> code came from> the storbuilder or from the basic admin templates.> > You can see toward the end there is a statement like this:> [fileinfo file=..[TargetPathNameExt]]> [showif [size]>50000] ........> > You should be able to follow the code, I'm giving you a good chunk of my> template here.> > Matthew A Perosi> nj-singles.com> ijo.com> > > > > ---------------code starts here-----------------------------> > > [!]=====================================================================[/!]> [!] Get target path info [/!]> [!]=====================================================================[/!]> > [text]TargetPath=[lookup> db=admin/prefs.db&value=QUEEN_GRAPHIC_PATH&lookInField=PREF&returnField=value]> [sku]/hold/[/Text]> > > > [!]=====================================================================[/!]> [!] retrieve information from the incomming form [/!]> [!]=====================================================================[/!]> > [formvariables]> > [showif [url][name][/url]^[url]pic[/url]]> [text]whichpic=[value][/text]> [/showif]> > [showif [url][name][/url]^[url]theFile[/url]]> [showif [url][name][/url]^[url]filename=[/url]]> [text]sourceSpecified=No[/text]> [/showif]> [hideif [url][name][/url]^[url]filename=[/url]]> [text]sourceSpecified=Yes[/text]> [/hideif]> > > [text]temp=[Middle StartAfter=filename=][name][/Middle][/Text]> [text]SourcePathNameExt=[Middle> StartAfter=&EndBefore=][temp][/Middle][/Text]> [ListWords Words=[SourcePathNameExt]&Delimiters=/\]> [text]SourceNameExt=[word][/Text]> [/ListWords]> > > [text]sourceValid=No[/text]> [showif [url][name][/url]^[url].png[/url]]> [text]TargetExt=png[/text]> [text]sourceValid=Yes[/text]> [text]TargetNameExt=[SourceNameExt][/text]> [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text]> [/showif]> [showif [url][name][/url]^[url].jpg[/url]]> [text]TargetExt=jpg[/text]> [text]sourceValid=Yes[/text]> [text]TargetNameExt=[SourceNameExt][/text]> [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text]> [/showif]> > [/showif]> [/formvariables]> > > [!]=====================================================================[/!]> [!] parse info for use in the createthumbnail.pl script [/!]> [!]=====================================================================[/!]> [text]filenamelen=[countchars][TargetNameExt][/CountChars][/text]> [text]filelen=[math][filenamelen]-4[/math][/text]> [text]extstart=[math][filenamelen]-2[/math][/text]> [text]file=[getchars> start=1&end=[filelen]][TargetNameExt][/getchars][/text]> [text]ext=[getchars> start=[extstart]&end=[filenamelen]][TargetNameExt][/getchars][/text]> > > > [!]=====================================================================[/!]> [!] Everything is correct -- continue [/!]> [!]=====================================================================[/!]> > [showif [sourceSpecified]=Yes]> [showif [sourceValid]=Yes]> > [showif [TargetPathNameExt]!]> [formvariables]> [showif [url][name][/url]^[url]theFile[/url]]> [writefile file=..[TargetPathNameExt]&secure=F][value][/writefile]> [/showif]> [/formvariables]> > [fileinfo file=..[TargetPathNameExt]]> [showif [size]>50000]> [text]imagesize=[size][/text]> [text]error=1[/text]> [text]message1=
The following errors> occured...
[/text]> [text]message3=Your file must be less than> 50K.
[/text]> [/showif]> [/fileinfo]> > [showif [error]=1]> [deletefile file=..[TargetPathNameExt]]> [/showif]> > > ---------------code ends here-----------------------------> > > > > Daniel Schutzsmith wrote:> >> Aside from the lovely, spirited discussion about privacy and consumer>> relations I would like to actually ask something relevant to this list.>> >> Has anyone devised a way to allow only a maximum amount for an upload? I>> want to restrict the user from uploading anything larger than 3MB. Has>> anyone made this possible.>> >> Alternative methods are also encouraged as I am looking for any good>> solution with WebDNA or a combination of other languages.>> >> Thanks>> >> ~dan>> >> >> ----------------------------->> Daniel Schutzsmith>> Senior Web Developer>> Berlin Productions, Inc.>> dan@berlinprod.com>> http://www.berlinprod.com>> (914) 683-5759>> (914) 683-5751 fax>> ----------------------------->> >> >> >> >> ------------------------------------------------------------->> 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/-----------------------------Daniel Schutzsmith Senior Web DeveloperBerlin Productions, Inc.dan@berlinprod.comhttp://www.berlinprod.com(914) 683-5759(914) 683-5751 fax------------------------------------------------------------------------------------------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/
Daniel Schutzsmith
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 Use Question (1997)
Web Developer Product Awards (1997)
WebCat2 - [include] tags (1997)
Mac installer (2000)
[WebDNA] Triggers not working (2011)
Problems passing [SKU] with $Replace in 2.0 (1997)
WebCat2 Append problem (B14Macacgi) (1997)
More on the email templates (1997)
Grep Help (2003)
Secure Server (1997)
[WebDNA] thisAutonumber? (2011)
Showing Results Alphabetically in Columns (top to bottom) (2002)
Reversed words (1997)
Security & Query Strings (2004)
Kaaaaahhhhhhhnnnnnnn! (1997)
Version f1 status (1997)
[WebDNA] Dynamic server feedback? (2009)
suffix mapping for NT? (1997)
sendmail and accented characters (1998)
calculating tax rates, mail order solutions and version 2 (1997)