Gossamer Forum
Home : Products : DBMan : Customization :

Problems with Upload Mod after Server Change

(Page 1 of 2)
> >
Quote Reply
Problems with Upload Mod after Server Change
Hi,

I have a problem I cannot figure out.
Last week we moved to another Server, running Apache and Proftpd. Everything works very well except one point in DBMan: I´ve installed the upload Mod to store pictures.
Now the error: On the old server everything works, on the new server I cannot upload. The logfiles don´t say anything. Additionally the upload script creates the directory imges/IdNr but cannot store the file in the directory. This is the error message I get!
I just tried for 3 days, but I have no idea. Can anyone help?
Thanks, Thoki.

PS: Excuse my bad english

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
It's possible that your new server has some odd settings. Some servers do not allow you to change the permissions of the directory through a script. And some do not allow 777 permissions for a directory.

Open your FTP program and check the directory that was created. See what the permissions are.

That's the only thing I can think of that would cause the problem.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
JPDeni,

you´re right. The permission is set to 755. What can I do?

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
I'm not sure. The script sets the permission to 777, or at least it tries to, so obviously there's a setting at the server end which is prohibiting it.

I would ask the server administrator about it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
OK, how can I figure out if the setting of the permission fails? The debug-modus of DBMan doesn´t tell me anything. /v/l/m too....*grrrr*

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
The FTP app you use to Chmod files will tell you if the permission setting failed or not...

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Ok, I tried to. But I had another idea, that worked, to set the permissions:
In sub validate_upload I added the following:
if (!(-e $SAVE_DIRECTORY/$newdirname)) {
$dirsuccess = mkdir "$SAVE_DIRECTORY/$newdirname", 0777;
chmod (0777, "$SAVE_DIRECTORY\/$newdirname"); <==!!!!!!
}
That works fine to set the DIR-Permissions correctly.
Now the script runs into the following error:
if (!open(OUTFILE, "$SAVE_DIRECTORY\/$newdirname\/$filename")) {
return "Ein Fehler trat beim Öffnen von '$SAVE_DIRECTORY\/$newdirname\/$filename' auf. Kann Datei nicht schreiben.\n";
}

Here I cannot imagine why????

Thoki

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Ah. For some reason your server does not allow setting the permission at the time the directory is created. Glad you found an answer.

As for your other error, I don't know what Ein Fehler trat beim Öffnen von '$SAVE_DIRECTORY\/$newdirname\/$filename' auf. Kann Datei nicht schreiben means, so I can't tell you what's going on. Can you translate it back into English please? Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Hi, JPDeni,

this was the original Statement:

if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$newdirname\/$filename")) {
return "There was an error opening '$SAVE_DIRECTORY\/$newdirname\/$filename' for Writing.\n";
}

OK?
Thoki.

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Thanks! Smile

Sounds like it's still a permission problem. I really think your server has things set so that no one can write to directories. There are a number of them that do that.

I really think you should talk to your server administrator and find out what the setting is. It doesn't help for me to try to find out what the problem is if the problem is with your server.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Oh no, JPDeni,
it is my Server running a "Standard"-Apache ;)
And, on the other hand, An UBB is running there, too. And, as you know, the UBB creates files dynamically. In my UBB I have an upload.cgi as well; that works!!!!
It must be something with the stor-routine....
Oh god, my english....;(
Thoki

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Then I would check to be sure that the $SAVE_DIRECTORY variable is set to the full path for the current server.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Wait a minute......
Here it is: /www/username/html/auto/images...ok, the /www is a symlink to /usr/local/httpd/htdocs.
But I think you´re wromg, because the db.cgi finds the upload-path correctly and does a mkdir "IDNr" under images....

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
OK, another idea, but I have to ask before:
How does the saving of the file work? Is there a Temp-DSirectory in use?

Idea: How can we try to copy an explicit file from a to b out of the script? I would think, that would be a good test. Do you agree?

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
I don't know how it works, really. The uploading of the file is done internally. Most of the code in the mod was copied from elsewhere, as referenced at the beginning of the mod.

You may need to find someone who knows a whole lot more about Perl than I do.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
As long I read your postings due to the problems of other users I think, you have much much more knowings of perl than I have.
But I will go ahead testing and figuring out, where the bug is.
Do you think it´s worth to implement my little "workaround" with the setting of the permissions into the Upload-Mod?

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
I don't really know that much about Perl. I do know a lot about DBMan. Smile

Your workaround looks fine, but it doesn't seem to solve your problem. I don't think it will hurt anything for it to be there, though.

I just thought of something you might try. Go to http://coldbird.com/scripts/index.html and download File_Upload-6.00.zip. Install that script on your site and see if it works. Since that script is the basis for all of the DBMan upload mods, it would might help to see what happens with it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
JPDeni, I have to thank you for our "CHAT" ;)
I will give it a try with that URL.
Are you interested to keep in touch with that?
Yours
Thoki.

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
I'm not sure what you mean by "keeping in touch with that." If the other script works, then there is a problem in the mod. If it doesn't, then there is a problem with your server. Since the mod worked on your other server, I'm leaning toward a problem with your server.

But if there's a problem with the mod, I'm willing to try to figure out what it is.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
With "keep in touch" I mean to have contact about that problem. (again, my english :((
OK, I´ve installed the file-upload-script and it works!!!!!!!!!!!!

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
I tried the following:

if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$newdirname\/$filename")) {
return "There was an error opening '$SAVE_DIRECTORY\/$newdirname\/$filename' for Writing.\n 'Error: $!\n'";

That returns: 'Error: No such file or directory '

Now I´m completely confused.
}

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
What does the error message say before "Error: No such file or directory"? There should be

"There was an error opening..." with the path to your directory. Is this path correct? Does the directory exist?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
That is the problem: The shown path is absolutely correct!

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
oops...and the path exists, too! I´m just wondering, why the file-upload.cgi works....it seems to be the same code...

Quote Reply
Re: Problems with Upload Mod after Server Change In reply to
Ok, I think I give it up for today...maybe better to sleep about it :-)
JPDeni, lot of thanks for your time!!!!!!!

I´ll watch this thread if another user has a good hint for me.

Thoki.

> >