image upload? permissions?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
atracksler

image upload? permissions?

Post 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
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: image upload? permissions?

Post by Ted »

Can you paste your config.php file with database information removed?  Thanks
atracksler

Re: image upload? permissions?

Post 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';

?>

Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: image upload? permissions?

Post 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!
atracksler

Re: image upload? permissions?

Post 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

Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: image upload? permissions?

Post by Ted »

Well, it did get rid of the 2nd slash.  :)

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

Re: image upload? permissions?

Post by atracksler »

duh.

that was it.

Thanks a million!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: image upload? permissions?

Post by Ted »

Sometimes I should just start with the obvious.  *sigh*  Oh well.  Glad it's working.  And I have a bug to fix.  :)
Locked

Return to “CMSMS Core”