Gossamer Forum
Home : Products : DBMan : Customization :

minor alteration in JP Deni's multiple file upload mod

Quote Reply
minor alteration in JP Deni's multiple file upload mod
I've just added Carol's multiple file upload mod to my copy of dbman and noticed a problem. When the user creates a record that is to include a file and does not fill in all the required fields, dbman will kick the record back to the user and advise them what to do (ie date format bad, some field blank that shouldn't be, etc). Problem is that the multiple file upload mod has aready created the directory but not put anything in it. So now when the user finishes filling out the form and finally adds the record they get an error from the sub validate_upload that says unable to open directory. The solution seems to be to just remove the error catching and allow it to plow right on thru.
In sub validate_upload
find thes lines:
opendir (GRAPHIC, $SAVE_DIRECTORY/$newdirname) or &cgierr("unable to open directory. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
and replace opendir line with this:
opendir (GRAPHIC, $SAVE_DIRECTORY/$newdirname) ;
Wes