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 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/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Upload Maximum (Dan Strong 2003)
  2. Re: Upload Maximum (Brian Boegershausen 2003)
  3. Re: Upload Maximum (Clint Davis 2003)
  4. Re: Upload Maximum (Daniel Schutzsmith 2003)
  5. Re: Upload Maximum (Daniel Schutzsmith 2003)
  6. Re: Upload Maximum (Matthew A Perosi 2003)
  7. Re: Upload Maximum (Chris List Recipient 2003)
  8. Re: Upload Maximum (Dan Strong 2003)
  9. Upload Maximum (Daniel Schutzsmith 2003)
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 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/ 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:

[WebDNA] WebDNA FastCGI (2012) Fun with Dates - finally resolved but.... (1997) Simple way to create unique SKU (1997) Re:Searching for ALL / empty form field (1997) How Many SKU's is enough? (1997) GuestBook example (1997) customizing the color of user's pages (1997) hmmm (2006) shownext not showing next...still r2 (1997) Where's 3.0 Online Docs? (1999) Max Record length restated as maybe bug (1997) Missing something simple?? (1998) Secure server question (1997) error -108 (1997) WebCat2 beta 11 - new prefs ... (1997) Date sorting (1997) Sku numbers (1997) [WebDNA] Repeated Task [reworking a DB) (2015) [WebDNA] Credit card processing (2012) form crasehes server (1997)