Crazy with upload dir

M

Marco T

Guest
Hello,
I'm getting crazy with the upload dir.

The upload and following reference to the uploaded files work only if I don't put anything in the dir variables, i.e.:

$upload_relative_url = '';
$upload_directory = '';

But then, when I try to Edit or Delete a record, I get the 404 error.

I can see the the uploaded files fall in the dadabik root directory.

OTHERWISE_______
If I put the default:

$upload_relative_url = 'uploads/';
$upload_directory = '';

the uploaded files again fall in the dadabik root directory, but then the script searches the files in the (root)/uploads/ directory (and of course it doesn't found them).

OTHERWISE________
if I put something in the
$upload_directory =
I get an error while inserting a new record.

Please help me, I can't fix this even looking at the other posts on this forum.

Thank you very much,
Marco

 
D

Debbie Sontag

Guest
Marco

Ensure your settings in config.php are like this (replacing your.server.com and databik-dir with your own appropriate names where applicable):

--------------------

$site_url = 'http://your.server.com/dadabik-dir/';
*** if you do not have your correct site url defined here, you will get the 404 error when attempting to insert, update or delete records - whether you are uploading files or not.

$upload_relative_url = 'uploads/';
*** make sure you enter the name of your uploads directory exactly as you've created it and that it has full permissions (chmod 777) otherwise users will not be able to write to it.

$upload_directory = '://your.server.com/dadabik-dir/uploads/';
*** for uploads to work, you MUST have the relative AND absolute paths defined.

$max_upload_file_size = 20000000;
*** ensure your maximum allowed size (in bytes) for files is large enough to handle the files that will be uploaded.

$allowed_file_exts_ar[0] = 'jpg';
$allowed_file_exts_ar[1] = 'gif';
//$allowed_file_exts_ar[2] = 'tif';
//$allowed_file_exts_ar[3] = 'tiff';
$allowed_file_exts_ar[4] = 'png';
$allowed_file_exts_ar[5] = 'txt';
//$allowed_file_exts_ar[6] = 'rtf';
//$allowed_file_exts_ar[7] = 'doc';
//$allowed_file_exts_ar[8] = 'xls';
$allowed_file_exts_ar[9] = 'htm';
$allowed_file_exts_ar[10] = 'html';
//$allowed_file_exts_ar[11] = 'csv';
$allowed_file_exts_ar[12] = 'pdf';
*** comment out with // the files you do not want users to be able to upload. If you are allowing any files to be uploaded, set the variable below to '1'

$allowed_all_files = 0;

--------------------

Unless you have ALL the paths and variables set correctly (host/directory names), you will get errors and uploaded files filed in the wrong directories.

Hope this helps solve your issue.

Debbie

(Latest version of DaDaBIK when this message was posted: 3.0)
 
M

Marco T

Guest
Thank you Debbie,
my site_url was wrong (missing final /), and also my virtual server support told me to use as absolute reference:

'/dnshome/mysite.com/htdocs/dadabik/uploads/';

Now everything seems to work perfectly. I like this script!!!

Ciao
Marco
 
D

Debbie Sontag

Guest
oooops!

Just noticed that I forgot the "http" part in the absolute uploads URL line above. Should read:

$upload_directory = 'http://your.server.com/dadabik-dir/uploads/';
*** for uploads to work, you MUST have the relative AND absolute paths defined.

Sorry for any confusion.

As for your virtual server support ... Sometimes the absolute URL that a server wants to see is as you've indicated. Because this is an exception and not the norm, the "http:" format URL is shown in the config.php.

Glad everything is working for you now!
I too think Eugenio has done an incredible job making this script. Hats off!

Debbie

(Latest version of DaDaBIK when this message was posted: 3.0)
 
D

Debbie Sontag

Guest
oooops again!!!

$upload_directory = '/home/path/to/dadabik-dir/uploads/';

I (twice) incorrectly made note of what the absolute URL for the uploads directory should be -- this information is in the config.php file also.

Debbie
(Latest version of DaDaBIK when this message was posted: 3.1 Beta)
 
Top