[Solar-talk] Lux_Filesystem_Upload
Jeff Surgeson
solar at 3hex.com
Mon Nov 5 08:06:48 CST 2007
On Monday 05 November 2007 15:27:57 Antti Holvikari wrote:
> On 11/5/07, Antti Holvikari <anttih at gmail.com> wrote:
> > On 11/5/07, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> > > On Nov 5, 2007 11:04 AM, Jeff Surgeson wrote:
> > > > Assuming the _config[replace] option is false then the
> > > > Lux_Filesystem_Upload::_validateFile() method will always produce an
> > > > exception as it only checks if path exists and not if the file being
> > > > uploaded exists.
> > > >
> > > > I assume that the purpose of the function is to see if the file
> > > > exists and if it does based on the config option replace or produce
> > > > exception, right?
> > >
> > > The purpose is to compare if the destination filename exists and allow
> > > a replacement, or throw an exception if 'replace' is false. The class
> > > does not check if the 'file' field of a form was empty. This is out of
> > > the scope of the class and you have to check it in your app. Makes
> > > sense?
> >
> > Hmm, I think it's confusing that it says $path, when it should say
> > $file. There is nowhere said that the destination should be a file or
> > a path. Jeff, am I correct that this confuses you?
>
> Crap, sorry. It creates the $path from the destination and filename,
> and it works the way it should. My bad.
If I replace $this->_file_name $this->_file['name'] it works.
_formatFileName() been called after the call to _validateFile() so the
$this->file_name member is NULL when _validateFile is called.
--
...........::::::...........
Jeff Surgeson / South Africa
More information about the Solar-talk
mailing list