Gossamer Forum
Home : Products : DBMan : Customization :

Multiple Upload - directory rights?

Quote Reply
Multiple Upload - directory rights?
I installed the Multiple File Upload successfully. I can upload an image but when I try to modify a record and add an image, I get the following error
Code:
DBMan encountered an internal error. CGI ERROR ========================================== Error Message : unable to open directory. Reason: No such file or directory Script Location : db.cgi Perl Version : 5.006001 Setup File : default.cfg

I find that the UserID dir within the uploads dir is set to rwxr-xr-x. When I change it to rwxrwxrwx, I can modify and add an image successfully. I found the line in the db.cgi . . .
Code:

$dirsuccess = mkdir "$SAVE_DIRECTORY/$newdirname", 0777;

. . . but why is the dir being created with the wrong rights??

Chris
Quote Reply
Re: [jnjhost] Multiple Upload - directory rights? In reply to
It may not be a problem with permissions, but rather than it can't locate the directory?

There have been some updates to the mod that you may not have. These can be found in the FAQ noted below. Here are some things you an check for:

Try putting quotes around the directory name in these lines if they are not already there.

unlink "$SAVE_DIRECTORY/$in{$db_key}/$key";

if (-e "$SAVE_DIRECTORY/$in{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$in{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");


The line with in the sub validate_upload is missing a few "".

The line which reads;"
$newdirname = $in{$db_key};
if (!(-e $SAVE_DIRECTORY/$newdirname)) {

SHOULD READ;
$newdirname = $in{$db_key};
if (!(-e "$SAVE_DIRECTORY/$newdirname")) {

All that was missing were the quotation marks around the directory name.


You may also need to change the following in sub validate_upload:

opendir (GRAPHIC, $SAVE_DIRECTORY/$newdirname) or &cgierr("Unable to open directory. Reason: $!");

add quotes around directory:

opendir (GRAPHIC, "$SAVE_DIRECTORY/$newdirname") or &cgierr("Unable to open directory. Reason: $!");

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Multiple Upload - directory rights? In reply to
Thank you Lois! I'll look into that!

Chris
Quote Reply
Re: [LoisC] Multiple Upload - directory rights? In reply to
Only the last change needed to be made and now it works. The rights for the record directory are rwxr-xr-x and I can still modify.

Thanks!! I'll have more questions . . . glad you are here.

Chris