[dev] Attachments Error Handling...
Michael M Slusarz
slusarz at mail.curecanti.org
Tue Nov 8 12:59:29 PST 2005
Quoting Marc Jauvin <marc at r4l.com>:
> Michael M Slusarz <slusarz at mail.curecanti.org> wrote:
>
>> Quoting Marc Jauvin <marc at r4l.com>:
>>
>>> I tried the following using latest CVS HEAD code:
>>>
>>> - attach a non-existent file
>>> - attach a file which I don't have read permission
>>>
>>> In both case, horde "thinks" everything worked well, creates the
>>> attachment (size=0), and gives NO error notification.
>>
>> I'm confused, simply because IMP did not produce an error message in
>> these cases previously. As far as PHP can tell, the upload was
>> successful - the filename is correct, and the filename simply has 0
>> size.
>>
>> the only thing we could do is to ignore 0 size uploads, but i'm not
>> sure if there is a drawback to this -- i.e. is it desirable for some
>> reason to allow 0 byte attachments?
>
> Personally, I would refuse 0 size uploads and produce a warning (like:
> file not found, or no permission to access the file).
Can't do this because the user may very well have been successful in
uploading the file - it just happens to be a 0 byte file. That's my
whole point - just because PHP reports 0 bytes doesn't mean there was
an error. The issue is that there is absolutely no way of us knowing
whether there was a user error or whether the attempted file upload was
simply an empty file.
I think the more proper message will be an informational message
(rather than an error message) that says "empty attachment file X
ignored" or something along those lines.
michael
_______________________________________
Michael Slusarz [slusarz at curecanti.org]
More information about the dev
mailing list