Gossamer Forum
Home : Products : DBMan : Installation :

Questions re: Upload Mod from JP Deni's site

Quote Reply
Questions re: Upload Mod from JP Deni's site
I had my database working fine today, but needed to add the mod for uploading JPG images.

I made all the changes and added the new validate_upolad subroutine, and now I'm getting internal server errors. I've double-checked to make sure all the ; and " are in the right places. I'll check them again.

Question 1: In the subroutine I see OPENDIR and CLOSEDIR references to something called GRAPHIC (as opposed to Graphic, which is my filename, which I changed) , but don't see where this value is set. Am I missing something? Is this the same thing as the filename and do I need to change it to match the filename I'm using?

Question 2: Since I haven't gotten that far yet, where does the subroutine get the image to be uploaded? Will it default to the user's C drive?

Thanks in advance.

Last edited by:

smithT: Dec 11, 2001, 1:17 PM
Quote Reply
I found one big problem In reply to
I realized the internal server error is because I didn't have the CGI.pm module installed. My server administrator is fixing that for me.

Once it's installed I hope I get my answers and won't have to bother you nice people again.
Quote Reply
Still no good In reply to
CGI.pm has been installed, I've checked and re-cecked and triple-checked all the syntax and code that I copied and pasted from the Upload mod and I still get an Internal Server Error when I try to execute the db.cgi script.

Any ideas?
Quote Reply
Re: [smithT] Still no good In reply to
I imagine that if it was a syntax error you'd get something like "dbman encountered an internal error" as opposed to "Internal Server Error".

The internal server error, in my experience, usually means a permissions or set-up issue.

I know this will make you want to scream, but make sure you're uploading in ASCII mode, and check your permissions (CHMOD). Also check the permissions of the upload directory (where the graphics will be placed).

If you get absolutely desperate, try creating another directory and upload the script there. Also try uploading a copy of the script that you *know* works. I keep the original unmodified dbman script around for just such reasons.

Quote Reply
I found the problem -- I think In reply to
Turns out my server is using an older version of Perl that's not compatible with the CGI.pm that was installed. I'm having it fixed within the next couple of days and will post again if I still encounter server problems.

Thanks.
Quote Reply
Re: [smithT] Questions re: Upload Mod from JP Deni's site In reply to
Question1: When you see something in capitals in connection with handling files, it's usually a "filehandle", and not some variable. It's got nothing to do with whatever variables you define. You could also replace GRAPHIC by SNOOPY, and it would still work. Just leave it as it is.

Question2: In your form, you have an input field of the type "file". Then you click on the "browse" button and select the file from your local drive. It could be "C:", "D:", "E:" - whatever you select. The complete file name, as selected, gets passed to dbman. This file is read and then written to the server path you specified as a value of (I believe) $SAVE_DIRECTORY.
kellner