Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
trouble uploading images
Avatar
jedson #1
Member since Jul 2006 · 19 posts · Location: Virginia
Group memberships: Members
Show profile · Link to this post
Subject: trouble uploading images
Hi --
Got my re-designed site up and almost everything works. One glitch. It won't upload images. I can put an image in the right file (using my ftp program -- K-Bear) and then use the dokuwiki based program to insert it into the article where I want it. But when I try to use the program to upload an image from my own computer I get a message that says, "upload failed -- maybe wrong permissions."  (This is true even if the image on my computer is set at 0777). It tells me that permission is denied and refers me to line 120 in lib/exe/media.php. On that line I find the beginning of this command:
     if(move_uploaded_file($file['tmp_name'], $fn)) {
            // set the correct permission here
            chmod($fn, 0777 - $conf['umask']);
Looking at the dokuwiki.php file I find that umask is set at 0111 and dmask at 000. All this is over my head, but I think this may be the relevant info. What do I need to do?

jedson
Avatar
purplepaisley #2
Member since May 2006 · 142 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Have you chmoded the media directory (and subdirectories) of your dokuwiki installation?

chmod 777 data/media
Avatar
jedson #3
Member since Jul 2006 · 19 posts · Location: Virginia
Group memberships: Members
Show profile · Link to this post
Subject: Chmoding
Double checked that. Both files and their contents are 777 and it still won't upload. Get the same message.

Jedson
Avatar
walfisch #4
Member since Aug 2006 · 6 posts · Location: Kiel
Group memberships: Members
Show profile · Link to this post
moin.

i have the same problem on our new wiki.
your questions brings me on the right way to find an resolution for that bug.
(i'm not a php-programmer !!)

problem: after uploading the file, the protection setting works buggy and
sets the permission to --- --- ---.
user and group settings are correct.


1) line 120 looks differnet from yours. the same code  if(move ...      begins at line 125 
    (different wiki versions ??)

2) line 122 chmod..... looks different from my code in line 127 => if($conf['fperm']) chmod($fn, $fperm);

3) i don't know, where $fperm is defined (but not in dokuwiki.php , local.php or media.php)

4) in my wiki release file and directory protection are defined in dokuwiki.php or local.php
$conf['fmode'] = '640';
$conf['dmode'] = '750';


a possible resolution for that problem in my release is:

5) replace the chmod line with the following 2 lines:
$fperm = $conf['fmode'];   => sets fperm to the value of fmode
chmod($fn, $fperm);   => protects the file $fn to the rights of $fperm = $fmode

hint:
don't set your directory's to mode=777, because is a security whole and allows everybody on the system to do anything.
set the protections like defined in dokuwiki.php / local.php and follow the readme's for correct installation
This post was edited 2 times, last on 2006-08-24, 14:28 by walfisch.
Avatar
jedson #5
Member since Jul 2006 · 19 posts · Location: Virginia
Group memberships: Members
Show profile · Link to this post
Subject: update
Useful information. However, when I substituted the scrip you sent it didn't do the trick for me. As you point out, I am not using the latest update for my site. I think I will use a test site I have to do the update and see how it works them. If it doesn't work with just the update I can try your script on the updated program. And see what that does. (You are more of a programmer than I am.)

Jedson
Avatar
p3aul #6
Member since Aug 2006 · 19 posts
Group memberships: Members
Show profile · Link to this post
When I've tried setting permissions and they don't work(dukiowiki) I have had some success with deleting the .htaccess file(s)
Paul
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-26, 15:28:53 (UTC +01:00)