Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 12:19:46 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: CHMOD problem in uploading files in Media-folder  (Read 2703 times)
wendydej

Offline Offline

Posts: 60


« on: March 05, 2006, 09:33:01 PM »

When I make new folders (for example media/images) in the mediafolder in WSB itself, everything works just fine. But when I want to insert an image into a page, the image doesn't show.

So far I have figured out that it has to do with CHMOD; the images automatically get CHMOD 600 when I upload them directly in WSB. In FTP I gave the media-folder CHMOD 777, but it still automatically gives every separate file 600. I can change this in FTP, but then I would have to change each image individually every time I upload.

My question is this: where do I change the CHMOD in the media folder, so that when I upload an image, it automatically gets 777 instead of 600? What code do I have to use?

I've already tried this solution by Stefan:

You can, however, change it from within WB by creating a code section with the following content:
Code:
chmod(WB_PATH.'/media/folder', 0777);
Remember that you need to view the page with this section to actually run it.



but that didn't work. I have version 2.6.2
Logged
rabsaul

Offline Offline

Posts: 263


WWW
« Reply #1 on: March 06, 2006, 10:17:07 AM »

Hm. I don't really think the image itself should need to be 777. Even 644 seems to work for me (from the FCK editor, anyway). But I'm not sure why yours are coming in as 600.
Logged
pcwacht
Guest
« Reply #2 on: March 06, 2006, 10:22:26 AM »

goto admin->settings->show advanced options

check the chmod settings there



John
Logged
wendydej

Offline Offline

Posts: 60


« Reply #3 on: March 06, 2006, 06:00:34 PM »

I've already tried setting the CHMOD setting in Advanced Settings ... actually, that was the very first thing I did when I came upon this problem.

OK, maybe I don't need 777, but it does strike me as odd that it uses 600 ...

Anyone else any thoughts on this?
Logged
wendydej

Offline Offline

Posts: 60


« Reply #4 on: March 10, 2006, 04:09:56 PM »

Please, is there someone who can help me with this problem? It's very annoying (not to mention plain stupid) that I can't see images if I upload them the 'normal' way (in WebsiteBaker itself).
Logged
Stefan
Guest
« Reply #5 on: March 10, 2006, 04:24:15 PM »

What about page access files (files under in the pages directory)? Do they get 600, too?
This might have something to do with umask. What permissions do files get that you upload via FTP?
Logged
wendydej

Offline Offline

Posts: 60


« Reply #6 on: March 10, 2006, 07:31:09 PM »

Nope, pages get 644. Files that I upload via FTP get 644 as well. Like I said, I can manually change every image to 644 via FTP, but that's not the way I want to do it. More people log in on this website, so I just want files to automatically CHMOD to 644 when uploaded in websitebaker.
Logged
wendydej

Offline Offline

Posts: 60


« Reply #7 on: March 12, 2006, 08:28:35 PM »

I've searched around a bit, and thought maybe someone knows a line of code I can put into this line of code to automatically changes the CHMOD to 644.

This piece of code is from admin/media/upload.php en runs from lines 83 to 94:

// Move to relative path (in media folder)
if(file_exists($relative.$filename) AND $overwrite == true) {         
    if(move_uploaded_file($_FILES["file$count"]['tmp_name'], $relative.$filename)) {
         $good_uploads++;
         // Chmod the uploaded file
         change_mode($relative.$filename, 'file');
       }
} elseif(!file_exists($relative.$filename)) {
     if(move_uploaded_file($_FILES["file$count"]['tmp_name'], $relative.$filename)) {
          $good_uploads++;
          // Chmod the uploaded file
         change_mode($relative.$filename);



Anyone?
Logged
Stefan
Guest
« Reply #8 on: March 12, 2006, 10:15:47 PM »

Well, that is exactly what change_mode() is supposed to do.
You can also check the value "string_file_mode" in the settings table of your database.
Logged
wendydej

Offline Offline

Posts: 60


« Reply #9 on: March 13, 2006, 04:33:34 PM »

Even the string_file_mode indicates 0644. I changed it to 0777 but that didn't do me any good either. Finally I just got so frustrated that I just started all over again (hoping that I had done something wrong in some settings) but still nothing.

A friend of mine suggested it might be something in my hosting-provider, but that doesn't make sense because I can create pages in WebsiteBaker without any problems, just not the images.

Does anyone have any other ideas where to look? This is really starting to annoy me .....
« Last Edit: March 13, 2006, 04:36:31 PM by wendydej » Logged
Stefan
Guest
« Reply #10 on: March 13, 2006, 05:28:34 PM »

Have you asked your provider about this?
You're the only one who has reported this problem, so it's at least a possibility...
Logged
D-Iivil

Offline Offline

Posts: 4


« Reply #11 on: June 06, 2008, 10:04:37 AM »

I have exactly the same problem here!

What could be wrong about chmod made by WB? All the uploaded images gets chmode 600, no matter what I have set in configuration page :I
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!