Page 1 of 1

image upload? permissions?

Posted: Mon May 08, 2006 8:41 pm
by atracksler
I cant seem to upload images,

here is the error I get:

Code: Select all

Warning: move_uploaded_file(/home/plannh/public_html/uploads/images//header.jpg): failed to open stream: Permission denied in /home/plannh/public_html/admin/imagefiles.php on line 83

Warning: move_uploaded_file(): Unable to move '/tmp/phpArXs6B' to '/home/plannh/public_html/uploads/images//header.jpg' in /home/plannh/public_html/admin/imagefiles.php on line 83

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 161

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 164

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 167

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 176
the // before the images makes me wonder what the problem is.

Any help is appreciated.

--ad

Re: image upload? permissions?

Posted: Mon May 08, 2006 10:05 pm
by Ted
Can you paste your config.php file with database information removed?  Thanks

Re: image upload? permissions?

Posted: Tue May 09, 2006 1:01 pm
by atracksler

Code: Select all


<?php

$config['dbms'] = 'mysql';
$config['db_hostname'] = 'xxx';
$config['db_username'] = 'xxx';
$config['db_password'] = 'xxx';
$config['db_name'] = 'xxx';
$config['db_prefix'] = 'cms_';
$config['root_url'] = 'http://brycecreative.com/~plannh';
$config['root_path'] = '/home/plannh/public_html';
$config['query_var'] = 'page';
$config['use_bb_code'] = false;
$config['use_smarty_php_tags'] = false;
$config['previews_path'] = '/home/plannh/public_html/tmp/cache';
$config['uploads_path'] = '/home/plannh/public_html/uploads';
$config['uploads_url'] = 'http://brycecreative.com/~plannh/uploads';
$config['max_upload_size'] = 1000000;
$config['debug'] = false;
$config['assume_mod_rewrite'] = false;
$config['auto_alias_content'] = true;
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';
$config['use_Indite'] = false;
$config['image_uploads_path'] = '/home/plannh/public_html/uploads/images';
$config['image_uploads_url'] = 'http://brycecreative.com/~plannh/uploads/images';
$config['default_encoding'] = '';
$config['disable_htmlarea_translation'] = false;
$config['admin_dir'] = 'admin';
$config['persistent_db_conn'] = false;
$config['default_upload_permission'] = '664';
$config['page_extension'] = '.html';
$config['use_adodb_lite'] = true;
$config['locale'] = '';
$config['admin_encoding'] = 'utf-8';

?>


Re: image upload? permissions?

Posted: Tue May 09, 2006 4:42 pm
by Ted
That is too strange.  I have no idea where that extra slash is coming from...

Open up imagefiles.php.  Go to line 83.  It should look something like:

Code: Select all

if (!move_uploaded_file($_FILES['uploadfile']['tmp_name'], $dir."/".$_FILES['uploadfile']['name']))
Change it to:

Code: Select all

if (!move_uploaded_file($_FILES['uploadfile']['tmp_name'], $dir.$_FILES['uploadfile']['name']))
See if that helps.  If so, then I'll put in a little logic there to strip off a slash if it shows up.

Thanks!

Re: image upload? permissions?

Posted: Tue May 09, 2006 5:37 pm
by atracksler
nope, here is my new error:

Code: Select all

Warning: move_uploaded_file(/home/plannh/public_html/uploads/images/910-3.jpg): failed to open stream: Permission denied in /home/plannh/public_html/admin/imagefiles.php on line 83

Warning: move_uploaded_file(): Unable to move '/tmp/phpba70tL' to '/home/plannh/public_html/uploads/images/910-3.jpg' in /home/plannh/public_html/admin/imagefiles.php on line 83

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 161

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 164

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 167

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/plannh/public_html/admin/imagefiles.php:83) in /home/plannh/public_html/lib/classes/class.admintheme.inc.php on line 176


Re: image upload? permissions?

Posted: Tue May 09, 2006 6:31 pm
by Ted
Well, it did get rid of the 2nd slash.  :)

The web server does have permissions to write to uploads/images, right?

Re: image upload? permissions?

Posted: Tue May 09, 2006 6:45 pm
by atracksler
duh.

that was it.

Thanks a million!

Re: image upload? permissions?

Posted: Tue May 09, 2006 7:18 pm
by Ted
Sometimes I should just start with the obvious.  *sigh*  Oh well.  Glad it's working.  And I have a bug to fix.  :)