uploading files

guidancepca

New member
You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 8.1-Lerici released on 09-05-2017

Hi,

I am trying to upload a pdf doc as a field into a record in a table.

1. Am I right in thinking that dadabik looks to upload the file to the mydomain/dadabik/uploads directory?
If so .... and I have not changed upload directory details in the original config.php file...it actually uploads the file in to mydomain/dadabik/ directory.

Can you advise re changes I need to make re this.

2. What field data type should I set for the 'file1' field in my table which receives the link address(?) for the uploaded file.... is 'varchar' correct?

I am nearly there....It does upload a file .... to the above directory ... but when I click on it to open Iget a 'error failed to load pdf' error.

i don't know if this is because it can't find it or that my datatype is incorrect.

Thanks as always for your help.

Paul
 

eugenio

Administrator
Staff member
Hello,
I am not sure how you have changed the upload directory; there are two parameters:


$upload_relative_url (by default 'uploads/')


$upload_directory: here you have to write the absolute path of the upload dir, e.g. /home/my/path/dadabik/uploads/ (it depends on your file system).

Try first to leave $upload_relative_url as 'uploads/' and to write the correspondent path in $upload_directory, then upload a file, can you see it?

Best,
 

guidancepca

New member
Hi,

When lines from my config.php file look like:

183 $upload_relative_url = 'uploads/';
190 $upload_directory = 'http://www.pcalearning.net/dadabik/uploads/';

I have .htaccess file in the 'uploads/' directory with the line 'deny' in it.

I try to upload a file and get 'An error occurred when uploading a file.' (is the .htaccess file causing the error?)

When lines from my config.php file look like:

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

file uploads into dadabik root directory and I can see it there......but when i click on its icon in the dadabik database front end I get an 'Error Failed to load pdf document'

So basically....it does upload into the dadabik root directory but I get an error when I want to look at it using the dadabik front end.

Thanks,

Paul
 

guidancepca

New member
I think I have found it....

I now have config.php like ...

183 $upload_relative_url = 'uploads/';

and

190 $upload_directory = 'uploads/';

and it seems to work.

I also have

$allowed_all_files = 1;

which i assume is the right setting.


Thanks.
 

eugenio

Administrator
Staff member
Hello,
it is very strange it is working with that settings, are the files uploaded in the uploads folder?

Set $allowed_all_files = 1 only if you want to accept any kind of file, otherwise it is strongly recommended to use the $allowed_file_exts_ar settings.

Best,
 

Hardus

Member
Hi, I am getting exactly the same error and the same resolution above from @guidancepca solved it for me.

[pre]
DaDaBIK version 9.1-Monterosso enterprise, installed on 10-30-2018 (installation code: 141055bd834ba10aa6), the latest version of DaDaBIK is 9.1-Monterosso released on 09-12-2018

You are runnning the last release of DaDaBIK

PHP Version: 7.2.10-0ubuntu0.18.04.1

mysql version: 5.7.24-0ubuntu0.18.04.1

Web server: Apache/2.4.29 (Ubuntu)

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
[/pre]
 
Top