Idut home  
 

Idut Support / solution for chmod 600 problem when uploading a picture

You are not logged in.

  • Index
  •  » Support
  •  » solution for chmod 600 problem when uploading a picture

#1 2009-06-17 21:05:05

Jorn
New member
Registered: 2009-06-17
Posts: 1

solution for chmod 600 problem when uploading a picture

Hey guys,

First off all thanks for this piece of software, its very nice!
I have this running for some time now , and now I installed it on a new server and noticed that when I upload a picture via the admin panel, the picture thumbnail is made, but the picture itself is not shown when clicked on the thumbnail. After some searching I found out that the server people have some security on that makes the uploaded files CHMOD 600 , wich means it can not be seen by webusers, and you just see a red cross where the picture suppost to be.
After some testing and trial and error I found a way to make it work without having to beg your host to change settings.

This is how I done it:

Open the file Admin.php

Around Line 500 you will see (not exacly this text since I translated it myself to Dutch but you get the idea):

Code:

function doUpload($dir,$file){
        global $IG_CONFIG;
        echo "<b>Upload resultaten: </b><br/>";
        if(is_dir($IG_CONFIG['imagedir'].$dir)){
                $uploadfile = $IG_CONFIG['imagedir'].$dir."/".basename($file['name']);
                if (move_uploaded_file($file['tmp_name'], $uploadfile))     {
    echo $file['name']." is geupload naar $dir album.<br/>";

Add between the last 2 lines above the following:

Code:

chmod($uploadfile, 0644);

so the code looks like this:

Code:

function doUpload($dir,$file){
        global $IG_CONFIG;
        echo "<b>Upload resultaten: </b><br/>";
        if(is_dir($IG_CONFIG['imagedir'].$dir)){
                $uploadfile = $IG_CONFIG['imagedir'].$dir."/".basename($file['name']);
                if (move_uploaded_file($file['tmp_name'], $uploadfile))     {
    chmod($uploadfile, 0644);
                echo $file['name']." is geupload naar $dir album.<br/>";

What this does is after you uploaded the file the script will CHMOD the file to 644 , wich means that the image will display to all internet surfers.

Hope it helps you out if you have simular problems with uploading!

Take Care!

Offline

 

2009-06-17 21:05:05

Advert


  • Index
  •  » Support
  •  » solution for chmod 600 problem when uploading a picture