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] Is the AutoCommit preference still supported? (2010) Document Contains No Data! (1997) WebCat2 beta 11 - new prefs ... (1997) Default admin bug and how tech support reacted to it. (2000) b18 problem on NT 4.0 (1997) extending webcatalog (1997) Search multiple fields (1997) Search results templates (1996) Resending - Please help (1998) Umm...about those log files? (Off Topic) (1997) SSL (1998) weird convertchars behavior (2000) Multi-processor Mac info ... (1997) Converting characters to numbers ... (1997) Still Stumped on ShowNext...HELP! (1997) Using Applescript to process WebCatalog functions (1998) Multiple Pulldowns (1997) More on the email templates (1997) W* 4.2 / WebCat (TPro) 3.0.5b / OS 8.5.1 / BW G3 (2000) I can help! (1996)