HOW TO UPLOAD FILES WITH DADABIK?

R

Robert Maagdenberg

Guest
To whom it may concern:

I am having great difficulty uploading files with Dadabik. I have set the config to the following specifications:


--------------------
// select relative url from the DaDaBIK root dir to the upload folder - please put slash (/) at the end

$upload_relative_url = "uploads/";

// select absolute filepath - please put slash (/) at the end

// e.g. "c:\\data\\web\\dadabik\\uploads\\" on windows systems

// e.g. "/home/my/path/dadabik/uploads/" on unix systems

// make sure the webserver can write to this folder

$upload_directory = '/public_html/customers/uploads/';
-------------------

However I get the following messages when I try to upload the files...

Warning: move_uploaded_file(/public_html/customers/uploads/loupe.gif) [function.move-uploaded-file]: failed to create stream: No such file or directory in /home/evirtual/public_html/customers/include/business_logic.php on line 1297

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpu4H76W' to '/public_html/customers/uploads/loupe.gif' in /home/evirtual/public_html/customers/include/business_logic.php on line 1297
An error occurred when uploading a file.
 
E

Eugenio

Guest
Robert Maagdenberg wrote:

> To whom it may concern:
>
> I am having great difficulty uploading files with Dadabik. I
> have set the config to the following specifications:

[....]

Dan, Robert, check if your Webserver user has the write permission on the PHP temporary upload folder (specified in php.ini) and on the /upload forlder.

Eugenio.

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
R

Robert Maagdenberg

Guest
Eugenio,

I just called my isp and discovered that only administrators have write permission for the tmp file (php.ini). Is there a work around. I do have write permission for the /upload file. I really want this to work.

Robert408-456-6706
 
R

Robert Maagdenberg

Guest
Eugenio,

I was wondering if you had a solution to the upload problem I am still having..I can't change my php.ini file but the /uploads file is set to chmd 777. Here is the error currently:

Warning: move_uploaded_file(/public_html/customers/uploads/dadabik_tmp_file_cancel.gif) [function.move-uploaded-file]: failed to create stream: No such file or directory in /home/evirtual/public_html/customers/include/business_logic.php on line 649

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php6pPIG4' to '/public_html/customers/uploads/dadabik_tmp_file_cancel.gif' in /home/evirtual/public_html/customers/include/business_logic.php on line 649
An error occurred when uploading a file.
 
M

Mark

Guest
You can chmod the file via php, check this forum for some different ideas (might want to try my fix at http://www.dadabik.org/forum/read.php?f=1&i=1065&t=978#reply_1065).

Regards,

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
R

Robert Maagdenberg

Guest
Eugenio and / or Mark,

I tried the suggestions that you provided and I still get the following errors:

Warning: move_uploaded_file(/public_html/customers/uploads/dadabik_tmp_file_loupe.gif) [function.move-uploaded-file]: failed to create stream: No such file or directory in /home/evirtual/public_html/customers/include/business_logic.php on line 649

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpkl4nzY' to '/public_html/customers/uploads/dadabik_tmp_file_loupe.gif' in /home/evirtual/public_html/customers/include/business_logic.php on line 649
An error occurred when uploading a file.

I can't change the php.ini file (only admins can do that). If you have any suggestions/modifications to this I would really be happy. I would like to store files that are assoiated with particular people I have in the db.

Thanks,

Robert
 
R

Robert Maagdenberg

Guest
Eugenio,

I really like your application. I know I might be bothering you but I have spent hours trying to figure out how I can get the upload to work properly. I don't have access to the php.ini file. I have chmod 777 the upload file. Can you help? Is there a work around? I still get the following error 649.

Robert
 
R

Robert Maagdenberg

Guest
Eugenio,

I really like your application. I know I might be bothering you but I have spent hours trying to figure out how I can get the upload to work properly. I don't have access to the php.ini file. I have chmod 777 the upload file. Can you help? Is there a work around? I still get the following error 649.

Robert
 
R

Robert Maagdenberg

Guest
Eugenio ,

I called my ISP about the settings in the php.ini file and they said that I am able to write to the /tmp directory. I still get the 649 error. The section of the business_logic.php that is not working is the following:

if (!(move_uploaded_file($file_name_temp, $upload_directory.$file_name)))

I have no idea how to get this to work. Can you help? I can send you the business_logic.php file. I just don't know.

Robert
 
R

Richard

Guest
I had probems until I allowed all extension:

$allowed_all_files = 1; // set to 1 if you want to allow all extensions, and also file without extension
 
E

Eugenio

Guest
Robert Maagdenberg wrote:

> Eugenio ,
>
> I called my ISP about the settings in the php.ini file and
> they said that I am able to write to the /tmp directory. I
> still get the 649 error. The section of the business_logic.php
> that is not working is the following:
>
> if (!(move_uploaded_file($file_name_temp,
> $upload_directory.$file_name)))
>
> I have no idea how to get this to work. Can you help? I can
> send you the business_logic.php file. I just don't know.

This line is not correct:

if (!(move_uploaded_file($file_name_temp, $upload_directory.$file_name)))

the line is actually:

if (!(move_uploaded_file($file_name_temp, $upload_directory.'dadabik_tmp_file_'.$file_name)))

in DaDaBIK 2.2.1
have you changed it?
Try to re-download DaDaBIK and reinstall it.

Eugenio.

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
R

Robert Maagdenberg

Guest
Eugenio,

I saw your suggestions and I have initially tried to use the line you provided but I still get an error. I am wondering if it has something to do with the database schema. Here is a copy:

CREATE TABLE customers_tab (
ID_cust smallint(6) NOT NULL auto_increment,
first_name varchar(50) NOT NULL default '',
last_name varchar(50) NOT NULL default '',
country varchar(50) NOT NULL default '',
phone varchar(20) NOT NULL default '',
email varchar(50) NOT NULL default '',
web_site varchar(100) NOT NULL default '',
notes text NOT NULL,
status text NOT NULL,
job_request varchar(255) NOT NULL default '',
job_quote varchar(255) NOT NULL default '',
job_doc varchar(255) NOT NULL default '',
co_name varchar(255) NOT NULL default '',
co_address varchar(255) NOT NULL default '',
PRIMARY KEY (ID_cust)
) TYPE=3DMyISAM;
 
R

Robert Maagdenberg

Guest
Can anyone help me with my 649 error? I took all the suggestions that everyone has made and I am still getting this error. Of course I would gladly pay you for your services. I resinstalled the business_logic.php and still get the error.

Robert
408-373-4038
 
P

PLMresearch

Guest
Robert,

Try changing the path to your upload directory using the absolute path. Bet it should look something like this:

$upload_directory = "/usr/www/users/YOURACCOUNT/customers/include/uploads/";

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
R

Robert Maagdenberg

Guest
I finally got it to work!

Thanks so much!!!! :)))

However I was wondering if there was a way to associate many files to one record (one to many). In other words one record can have 5 or 6 image files stored. What happens is if I try to upload a second file it is simply overwritten with the new file

Robert
 
P

PLMresearch

Guest
The latest version of Dabik should _not_ overwrite files - it simply adds a version number to the latest (and I believe the old one stays, correct Eugenio?). As far as multiple images, simply add the fields in your table and internal table.

Curious, was it the path that was giving you trouble?

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
R

Robert Maagdenberg

Guest
Dan?

Yes, the path was giving me fits all this time. It was so easy! :))))

The only problem that I see is that when I try to upload a file into a field that already has an existing file the new file replaces the old one when I go to view the record. What would be ideal (and I believe to make this really robust) is to have the ability to upload an unlimited number of files that a field can hold and those files would be associated with that field

For example

ID 231

Would have displayed in the display record section of the database:

file1.gif
file2.gif
file3.gif, etc.

Currently file1.gif is overridden by file2.gif as it is displayed
 
R

Robert Maagdenberg

Guest
Dan or Eugenio,

I finally figured out what the problem is..

In the form.php it is only displaying the current uploaded image file. What I think would be ideal is to have all files that correspond for that record displayed--not just the current.
 
E

Eugenio

Guest
Robert Maagdenberg wrote:

> Dan or Eugenio,
>
> I finally figured out what the problem is..
>
> In the form.php it is only displaying the current uploaded
> image file. What I think would be ideal is to have all files
> that correspond for that record displayed--not just the
> current.

Do you still have the problem?
Are you talkink about this bug?

"Upload failed when two files with the same name are uploaded in the same time."

the bug has been fixed in the new 3.0 version, which will be available soon.



(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
Top