Gossamer Forum
Home : Products : DBMan : Customization :

File upload not saving properly

Quote Reply
File upload not saving properly
Hi, I have limited Perl scripting background but I can understand scripts if I stare at them for a while. I have installed the demo dbman and have implemented the multi-upload mod changes. The script goes through the motion of adding the record but the link to the uploaded file is in the cgi-bin instead of the uploads directory that is defined by $SAVE_DIRECTORY. I don't know why it isn't saving the file there. I just want to be able to upload a file, any file (.doc, .xls, .pdf, .jpg, .psd, etc.) to the upload directory and be able to click on the link in the view records to open the file. What could I be doing wrong? I've gone through the instructions for JPDeni's multifile upload mod several times and can't seem to pinpoint the problem. Does anyone have any idea what I'm missing? Thanks.
Quote Reply
Re: [markyh] File upload not saving properly In reply to
Okay, I've gotten it to a point where the directory/filenames are created by they are all 0 kb. What could be causing this? I've set up both the single file and multiple file uploads and both seem to create filenames but are all 0 kb size. Any suggestion is appreciated.

Mark
Quote Reply
Re: [markyh] File upload not saving properly In reply to
There are some fixes you may need to make to the mod:

In sub validate_upload

change the following lines to include the quotes around the directory name:

if (!(-e "$SAVE_DIRECTORY/$newdirname")) {

and

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


To allow various file types you will need to ajust this line in your .cfg file:

$ALLOWED_EXT = '\.gif$|\.jpg$|\.doc$|\.pdf$|\.htm$|\.htm$l|\.GIF$|\.JPG$|\.DOC$|\.PDF$|\.HTML$|\.HTM$';

If that doesn't fix your problem, please visit the DBMan FAQ noted below in the section "Images" for any additional fixes or posted solutions for the mod.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/