Thanks Nick :) Hey If I get a chance I'll format these snippets and throw them onto the wiki in the recipies section. It really isnt that well documented , so It'll be a handy thing to have in there.
Your all stars :) Shayne. -- Shayne O'Neill http://perth.indymedia.org I know how hard it is for you to put food on your family." ----George W. Bush On Mon, 29 Mar 2004, Nick Murtagh wrote: > Shayne ONeill wrote: > > Thanks a million nick. I would apreciate an example.... > > This is a modified version of code I use... > > def bUploadFile(self, sDestinationPath): > '''Save uploaded file to sDestinationPath. > On error return 0. On success return 1. > Form has <input type="file" name"fUpload" ... > > ''' > > if not self.request().hasField('fUpload'): > return 0 > > fUpload = self.request().field('fUpload') > if not hasattr(fUpload, 'file'): > return 0 > > try: > fOut = file(sDestinationPath, 'wb') > except IOError: > return 0 > > while 1: > sLine = fUpload.file.readline() > if not sLine: > break > fOut.write(sLine) > > fOut.close() > return 1 > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Webware-discuss mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webware-discuss > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss