Problem with uploaded images

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.
Post Reply
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Problem with uploaded images

Post by Terabyte »

Hello,

I'm new here but already after one day I'm starting to enjoy the system/script.

I have though a problem with uploading the images. There are uploaed fine, but the permissions they get are strange. One I have uploaded them, I can add them to content, but then when watching the page on the site with the image the image can't be read. This is the first time I encountered this problem om my server. Of course going in to the server I can pply new permissions and it works fine until .... next uploaded image. Any thoughts?

Server: IIS 6.0
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Problem with uploaded images

Post by tsw »

Cool, more IIS errors ;)


Have you tried setting new values in the File Creation Mask (umask) in Global Settings?
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

tsw wrote: Cool, more IIS errors ;)


Have you tried setting new values in the File Creation Mask (umask) in Global Settings?
Can't find it.  I'm really that stupid? :-\

Runing 0.13 version by the way.

(Also found more problems with FCK editor. Maybe it is better to wait for 1.0....:) )
Last edited by Terabyte on Fri Aug 18, 2006 11:26 am, edited 1 time in total.
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

Installed 1.0 Beta. Same problem here and I found the "File Creation Mask" and tried different like 111 (all permissions) but stil don't work. The file created (uploaded image) I can't read, but the thumbnail created is fine!

Anybody. This and FCKEditor (java issue) is driving me crazy. Has been trying so many things now.....
Last edited by Terabyte on Fri Aug 18, 2006 8:18 pm, edited 1 time in total.
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

I think for the moment that this should be really looked at.  I would love to take a look and maybe find the problem.....

Update:

Found the function here:
lib\filemanager\ImageManager\Classes\Files.php and it is just so I want to cry  >:(

There is code there that uploads the image as I understand:
if (!copy($source, $destination_dir.$filename))
But even i I remove those lines the image get uploaded, so how and where does it get uploaded? Now I'm lost.
Last edited by Terabyte on Sat Aug 19, 2006 12:21 pm, edited 1 time in total.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Problem with uploaded images

Post by Elijah Lofgren »

Terabyte wrote: Installed 1.0 Beta. Same problem here and I found the "File Creation Mask" and tried different like 111 (all permissions) but stil don't work. The file created (uploaded image) I can't read, but the thumbnail created is fine!
For some reason on my web host I had to change the umask from "022" to "002" to be able to view thumbnails. But I'm not sure if this would fix a problem with the uploaded images not being able to be read.

From: http://wiki.cmsmadesimple.org/index.php ... l_Settings
Note: You may have to change File Creation Mask (umask): from "022" to "002" to keep from getting 403 forbidden errors when trying to view generated thumbnails on your webhost.
Also, maybe your image upload settings are messed up. You could try pasting your config.php here (without username and passwords!) and we could take a look at it.

I wish that IIS could be installed on Windows XP Home, but unfortunately it is only for Windows XP Pro so I can't test CMSMS with it.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

Elijah Lofgren wrote: For some reason on my web host I had to change the umask from "022" to "002" to be able to view thumbnails. But I'm not sure if this would fix a problem with the uploaded images not being able to be read.
Hello Elijah,

Thanks for the answer. Maybe I wasn't clear. The thumbnails are just fine. The permission are right! The files itself that are uploaded are the problem and the permission on them are messed up and that's why they are not readable. So it is not the thumbnails - it's the original files.

The unmask values has been tried. Not helping. The "default_upload_permission" can be set to almost everything since chmod function in php don't wotk on Windows anyway. I have seen different types of upload scripts and all work on Windows. Have been using Joomla for a long time and that worked to. Seems here there is some problem in the uplaoding process. Can't just figure out what it is.

Here is my config file:

Code: Select all

$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = '****';
$config['db_password'] = '****';
$config['db_name'] = '****';

#If app needs to coexist with other tables in the same db,
#put a prefix here.  e.g. "cms_"
$config['db_prefix'] = 'cms_';

#Use persistent connections?  They're generally faster, but not all hosts
#allow them.
$config['persistent_db_conn'] = false;

#Use ADODB Lite?  This should be true in almost all cases.  Note, slight
#tweaks might have to be made to date handling in a "regular" adodb
#install before it can be used.
$config['use_adodb_lite'] = true;

#-------------
#Path Settings
#-------------

#Document root as seen from the webserver.  No slash at the end
#e.g. http://blah.com
$config['root_url'] = 'http://www.lanta.se';

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = 'C:\Domains\lanta.se\wwwroot';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = 'C:\Domains\lanta.se\wwwroot\tmp\cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = 'C:\Domains\lanta.se\wwwroot\uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = 'http://www.lanta.se/uploads';

#---------------
#Upload Settings
#---------------

#Maxium upload size (in bytes)?
$config['max_upload_size'] = 10000000;

#Permissions for uploaded files.  This only really needs changing if your
#host has a weird permissions scheme.
$config['default_upload_permission'] = '664';

#------------------
#Usability Settings
#------------------

#Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
$config['use_smarty_php_tags'] = false;

#CMSMS Debug Mode?  Turn is on to get a better error when you
#see {nocache} errors.
$config['debug'] = false;

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = false;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = false;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

#--------------
#Image Settings
#--------------

#Which program should be used for handling thumbnails in the image manager.
#See http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Content/Image_Manager for more
#info on what this all means
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = 'C:\Domains\lanta.se\wwwroot\uploads\images';
$config['image_uploads_url'] = 'http://www.lanta.se\uploads\images'; 

#------------------------
#Locale/Encoding Settings
#------------------------

#Locale to use for various default date handling functions, etc.  Leaving
#this blank will use the server's default.  This might not be good if the
#site is hosted in a different country than it's intended audience.
$config['locale'] = '';

#In almost all cases, default_encoding should be empty (which defaults to utf-8)
#and admin_encoding should be utf-8.  If you'd like this to be different, change
#both.  Keep in mind, however, that the admin interface translations are all in
#utf-8, and will be converted on the fly to match the admin_encoding.  This
#could seriously slow down the admin interfaces for users.
$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';

#---------------------------------------------
#Use the old stylesheet logic?  It's much slower, but it works with older
#versions of CMSMS.  You'll also need this set to true if there is a module
#that uses a stylesheet callback.  Leave it as false instead you really
#need it.
$config['old_stylesheet'] = false;

# URL of the Admin Panel section of the User Handbook
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel';

#Not used anymore... kept around, just in case
$config['disable_htmlarea_translation'] = false;
$config['use_Indite'] = true;
Last edited by Terabyte on Sat Aug 19, 2006 10:52 pm, edited 1 time in total.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Problem with uploaded images

Post by Elijah Lofgren »

In your config.php try changing this line:

Code: Select all

$config['image_uploads_url'] = 'http://www.lanta.se\uploads\images'; 
to:

Code: Select all

$config['image_uploads_url'] = 'http://www.lanta.se/uploads/images/'; 
Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

Thanks Elijah, but that don't help either. The permissions are stil wrong. I think I have to start again looking at the uplaod function.
Terabyte
Forum Members
Forum Members
Posts: 79
Joined: Fri Aug 18, 2006 8:57 am

Re: Problem with uploaded images

Post by Terabyte »

:D :D :D ;D ;D ;D :D :D ;D ;D :D :D

It works!! I have no clue why other systems uplaod function don't have any problems with using the tmp uplaod path that is given by the default of the php on Windows, but it seems like cmsms has that problem. Settign a "non default" path for upload_tmp_dir variable in php.ini fixed the problem. Why? Don't know....but it works.

Now I have only the FCKeditor not listing the images....so the hunt of errors continue. Thanks for trying to help Elijah!
Post Reply

Return to “CMSMS Core”