Author Topic: 404  (Read 10393 times)

0 Members and 1 Guest are viewing this topic.

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
404
« on: March 03, 2006, 10:34:26 PM »
Set permissions for the following directories:

     chmod 777 (drwxrwxrwx) : data
     chmod 777 (drwxrwxrwx) : data/database
     chmod 777 (drwxrwxrwx) : data/media
     chmod 777 (drwxrwxrwx) : data/thumbnails
     chmod 777 (drwxrwxrwx) : data/tmp_media
     chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
     chmod 777 (drwxrwxrwx) : templates
     chmod 777 (drwxrwxrwx) : templates/default
     chmod 777 (drwxrwxrwx) : templates/default/media

     Set permissions for the following files:

     chmod 666 (-rw-rw-rw-) : all files in the directory "templates/default"
     chmod 666 (-rw-rw-rw-) : all files in the directory "templates/default/media"
But after I upload a picture, no thumbnail shows.(no picture) Then I click on the thumb, but i only get 404 that there is no picture,  So whats wrong.. i have no problem in 1.7.1, And all settings in adim is correct.

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: 404
« Reply #1 on: March 03, 2006, 10:43:41 PM »
you are activate GB-Biblothek?

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #2 on: March 03, 2006, 10:58:54 PM »
That's  activated..  I change the function.php from 1.7.2 to 1.7.1 and all is working, So there must be some wrong in the function.php files, but what??

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: 404
« Reply #3 on: March 04, 2006, 12:42:38 AM »
1) make sure files present in data/xx/ folders
2) if they do present there, then prove that these files are CHMOD 777 (show a screenshot of your FTP client or SSH console)

The reason I'm asking you to prove it, is because recently we had a few people claming that they did set everything correctly, but when they looked file permissions via a FTP client the files were not CHMOD 777
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #4 on: March 04, 2006, 08:13:04 AM »
The pictures are in the directory, but only shows if i use function.php from version 1.7.1
Have the same setting in 1.7.1 and its works , but not in 1.7.2
What i can see the pictures will not be found :(






And this is  what i get



Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: 404
« Reply #5 on: March 04, 2006, 04:30:08 PM »
As I mentioned above the files in data/xx/ folders must be CHMOD 777 on your screenshot they are CHMOD 666 what else do you want to know? ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #6 on: March 04, 2006, 06:26:06 PM »
As I mentioned above the files in data/xx/ folders must be CHMOD 777 on your screenshot they are CHMOD 666 what else do you want to know? ;)

Hm.. If i understand this, the jpg must be 777, and why?, in 1.7.1 it's 666, and how to change the settings??.. I did this change in function.php and all work, soo why will not the orginal function php work?..

This is the settings in 1.7.1 that i use to get it work, the files ,the directory and everything is the same, just except this change i did, and thats work, but still wonder why not orginal files work?..

function is_remote($file_name) {
  return strpos($file_name, '://') > 0 ? 1 : 0;
}

function is_remote_file($file_name) {
  return is_remote($file_name) && preg_match("#\.[a-zA-Z0-9]{1,4}$#", $file_name) ? 1 : 0;
}

function is_local_file($file_name) {
  return !is_remote($file_name) && strpos($file_name, '/') !== false && preg_match("#\.[a-zA-Z0-9]{1,4}$#", $file_name) ? 1 : 0;
}

function check_remote_media($remote_media_file) {
  global $config;
  return is_remote($remote_media_file) && preg_match("#\.[".$config['allowed_mediatypes_match']."]+$#i", $remote_media_file) ? 1 : 0;
}

function check_local_media($local_media_file) {
  global $config;
  return !is_remote($local_media_file) && strpos($local_media_file, '/') !== false && preg_match("#\.[".$config['allowed_mediatypes_match']."]+$#i", $local_media_file) ? 1 : 0;
}

function check_remote_thumb($remote_thumb_file) {
  return is_remote($remote_thumb_file) && preg_match("#\.[gif|jpg|jpeg|png]+$#is", $remote_thumb_file) ? 1 : 0;
}

function check_local_thumb($remote_thumb_file) {
  return !is_remote($local_thumb_file) && strpos($local_thumb_file, '/') !== false && preg_match("#\.[gif|jpg|jpeg|png]+$#i", $local_thumb_file) ? 1 : 0;
}

function get_file_extension($file_name) {
  ereg("(.+)\.(.+)", basename($file_name), $regs);
  return strtolower($regs[2]);
}

function get_file_name($file_name) {
  ereg("(.+)\.(.+)", basename($file_name), $regs);
  return $regs[1];
}

function check_media_type($file_name) {
  global $config;
  return (in_array(get_file_extension($file_name), $config['allowed_mediatypes_array'])) ? 1 : 0;
}

function check_thumb_type($file_name) {
  return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
}

function check_executable($file_name) {
  if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
    $file_name .= ".exe";
  }
  elseif (substr(PHP_OS, 0, 3) != "WIN") {
    $file_name = eregi_replace("\.exe$", "", $file_name);
  }
  return $file_name;
}

function get_file_path($file_name = "", $image_type = "media", $cat_id = 0, $in_admin = 0, $return_icon = 1, $check_remote = CHECK_REMOTE_FILES) {
  $return_code = ($return_icon) ? ICON_PATH."/404.gif" : 0;
  if (empty($file_name)) {
    return $return_code;
  }
  if (is_remote($file_name)) {
    $check_handle = "check_remote_".$image_type;
    return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
  }
  elseif (is_local_file($file_name)) {
    $check_handle = "check_local_".$image_type;
    $file_name = ($in_admin && preg_match("/^([\.]+|[^\/])/", $file_name)) ? "../".$file_name : $file_name;
    if (!file_exists($file_name)) {
      $file_path = preg_replace("/\/{2,}/", "/", get_document_root()."/".$file_name);
      return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
    }
    else {
      return $file_name;
    }
  }
  else {
    $check_handle = "check_".$image_type."_type";
    $path = (($image_type == "media") ? (($cat_id) ? MEDIA_PATH."/".$cat_id : MEDIA_TEMP_PATH) : (($cat_id) ? THUMB_PATH."/".$cat_id : THUMB_TEMP_PATH))."/".$file_name;
    return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
  }
}

function safe_htmlspecialchars($chars) {
  // Translate all non-unicode entities
  $chars = preg_replace('/&(?!#[0-9]+;)/si', '&', $chars);

  $chars = str_replace(">", ">", $chars);
  $chars = str_replace("<", "&lt;", $chars);
  $chars = str_replace("\"", "&quot;", $chars);
  return $chars;
}

function un_htmlspecialchars($chars) {
  //$chars = preg_replace("/(&#)([0-9]*)(;)/esiU", "chr(intval('\\2'))", $chars);
  $chars = str_replace("&gt;", ">", $chars);
  $chars = str_replace("&lt;", "<", $chars);
  $chars = str_replace("&quot;", "\"", $chars);
  $chars = str_replace("&amp;", "&", $chars);
  return $chars;
}

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: 404
« Reply #7 on: March 04, 2006, 06:52:47 PM »
CHMOD 666 is for images uploaded via PHP (members upload form or ACP) and CHMOD 777 for images uploaded via FTP

Now, I might jumped to conclusion that you uploaded files via FTP, I actualy dont know that, but anyways on your screenshots you showed only files in thumbnails folder, but what about files in media folder? these are more important for this issue.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #8 on: March 04, 2006, 07:01:25 PM »
CHMOD 666 is for images uploaded via PHP (members upload form or ACP) and CHMOD 777 for images uploaded via FTP

Now, I might jumped to conclusion that you uploaded files via FTP, I actualy dont know that, but anyways on your screenshots you showed only files in thumbnails folder, but what about files in media folder? these are more important for this issue.

Its the same in media folder 666 and i dont used the ftp to upload ../public_html/album/data/media/2/ alla jpg are 666

Try the ftp  and set all jpg files to 777 but not work...  (but the change i did work) :)

The setting in 4images is  (in constants.php)
// Chmod for files and directories created by 4images
define('CHMOD_FILES', 0666);
define('CHMOD_DIRS', 0777);
Soo the correct setting must be 666 for files..

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: 404
« Reply #9 on: March 04, 2006, 07:13:59 PM »
Ok, can you create a category where I can test uploading images?
PM me with site info if you dont want publish it.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #10 on: March 04, 2006, 07:31:25 PM »
Ok, can you create a category where I can test uploading images?
PM me with site info if you dont want publish it.
I get you a PM, not for the site , I give you admin account and you can uppload whatever you want

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: 404
« Reply #11 on: March 04, 2006, 07:55:31 PM »
Please redownload 4images package (delete your browser's cache just in case), it seems you downloaded this package in first 10 minutes after the release, which was a wrong package Jan mistakely uploaded...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline janne

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: 404
« Reply #12 on: March 04, 2006, 08:03:14 PM »
Please redownload 4images package (delete your browser's cache just in case), it seems you downloaded this package in first 10 minutes after the release, which was a wrong package Jan mistakely uploaded...

I did it and now its work 100 %...  And many many thanks for the help..