Not logged in. · Lost password · Register
Forum: General Help and Support General Stuff RSS
unable to upload file in Dokuwiki media manager
Avatar
gnirujan #1
Member since Aug 2015 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: unable to upload file in Dokuwiki media manager
Hi All,

I am new to dokuwiki, i last week downloaded the latest version of Dokuwiki and set it up in one of the servers in my company to use it for some internal user documentation. I am using Apache 2.4 and PHP 5.6.

I am facing an issue, when i try to upload image through media manager i get a error "failed" no other errors or any message, just says failed. Can anyone please help me with this?

Thanks
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4733 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Have you checked the error log?
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
haruna #3
Member since Dec 2015 · 1 post
Group memberships: Members
Show profile · Link to this post
I have same problem.

- php 5.5.27
- dokuwiki 2015-08-10a "Detritus"

What I tried

- disabling all plugins ->> nothing changed
- check sever error log ->> no message
- filesize ->> php.ini setting = "upload_max_filesize = 100M", uploaded file was 5KB.

Can anyone please help me?
Thanks
Avatar
SFITCS #4
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
In reply to post #1
Having checked the logs - have you checked the filename/s? (From unreliable memory) If the file name contains uppercase letters you'll get an unhelpful error message.

In linux just
echo "$Filename" | rename 's/ +\././; y/A-Z /a-z_/'
  to convert upper-case to lowercase (and spaces to underscores). Note that rename has -n option to dry-run, so it's good to test with it.
Avatar
SonoDavid2 #5
Member since Mar 2016 · 20 posts · Location: Belgium
Group memberships: Members
Show profile · Link to this post
I am currently having the same problem - pretty sure it has something to do with the php 5.6 version.
It's not the file size for sure and also not the plugins or theme.
The problem manifests itself on every browser, when uploading an image using the media manager, just says 'Failed'.
I'm looking into it now, but not sure if I will find a solution to this, I'll keep posting if I find something.

The same wiki files on another server work fine, by the way.
This post was edited on 2016-05-23, 12:49 by SonoDavid2.
Avatar
SonoDavid2 #6
Member since Mar 2016 · 20 posts · Location: Belgium
Group memberships: Members
Show profile · Link to this post
I found the error log on the server, when uploading a file this line is written into the log:

[Mon May 23 11:11:38 2016] [error] [client 81.82.205.48] ModSecurity:  [file "/etc/asl/modsecurity_crs_30_http_policy.conf"] [line "69"] [id "960010"] [msg "Request content type is not allowed by policy"] [severity "WARNING"] [tag "POLICY/ENCODING_NOT_ALLOWED"] Access denied with code 501 (phase 2). Match of "rx (?:^(?:application\\\\/x-www-form-urlencoded(?:;(?:\\\\s?charset\\\\s?=\\\\s?[\\\\w\\\\d\\\\-]{1,18})?)??$|multipart/form-data;)|text/xml)" against "REQUEST_HEADERS:Content-Type" required. [hostname "flowtime.be"] [uri "/dokuwiki/lib/exe/ajax.php"] [unique_id "V0LJSn8AAAEABZb-Pe8AAAAZ"]

I am fiddling a bit with the ajax.php file but no results yet.
Avatar
SonoDavid2 #7
Member since Mar 2016 · 20 posts · Location: Belgium
Group memberships: Members
Show profile · Link to this post
I found that I can't find the file /etc/asl/modsecurity_crs_30_http_policy.conf.
This is probably a file somehow hidden from view on the server?

So I don't really know what to do here, maybe someone can help? I'm guessing I'm not the only one with the file upload problem since i've seen a few topics about this.

I refer to the topics over here:
https://github.com/splitbrain/dokuwiki/issues/1104
https://forum.dokuwiki.org/thread/13051
This post was edited on 2016-05-23, 12:49 by SonoDavid2.
Avatar
SFITCS #8
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
If your explorations are made as root then it's not "hidden", more likely you just don't have it (or don't have it in the expected location).

You could just reconfigure modsecurity... providing a guide on how to do so would be simpler if I/we knew more about your circumstances.

Can you provide some information about your OS and version please?

Also - is this a VPS? Are you running virtual domains?

Thanks in advance.
Avatar
SonoDavid2 #9
Member since Mar 2016 · 20 posts · Location: Belgium
Group memberships: Members
Show profile · Link to this post
I am running the DokuWiki on a shared server. It runs on the same IP-adress as another website, but in a subdomain.
This shouldn't be the problem since I managed to do this with the same wiki installation on another server too, and that one runs fine.
I am able to log in to the server using ftp (using FileZilla on Windows 10) and found the etc folder in the root, but there are only two files: group and passwd. No other folders though.

Version of the Dokuwiki is Detritus (the last one) and it's running on PHP 5.6, probably with default settings since the shared server doesn't give me access to the PHP settings.
This post was edited 3 times, last on 2016-05-24, 18:21 by SonoDavid2.
Avatar
SFITCS #10
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Quote by SonoDavid2:
I am running the DokuWiki on a shared server. It runs on the same IP-adress as another website, but in a subdomain.

virtualdomain

Quote by SonoDavid2:
<snipped>
I am able to log in to the server using ftp (using FileZilla on Windows 10) and found the etc folder in the root, but there are only two files: group and passwd. No other folders though.

You are running as a user, not as root.
You are looking at /home/$User/etc, not /etc

e.g.
# ls -al /home/$SomeUser/etc
total 12
drwxr-xr-x  3 $SomeUser $SomeUser 4096 Jun 24  2015 .
drwxr-x--- 14 $SomeUser $SomeUser 4096 Jun 24  2015 ..
drwxr-xr-x  2 $SomeUser $SomeUser 4096 Dec 20  2012 php5
lrwxrwxrwx  1 $SomeUser $SomeUser   12 Jun 24  2015 php.ini -> php5/php.ini

as opposed to:-
# ls -al /etc                        
total 964
drwxr-xr-x 107 root     root      4096 May 25 11:00 .
drwxr-xr-x  21 root     root      4096 Apr 16 12:58 ..
drwxr-xr-x   3 root     root      4096 May 13  2015 acpi
-rw-r--r--   1 root     root      2981 May 13  2015 adduser.conf
-rw-r--r--   1 root     root        44 May 13  2015 adjtime
-rw-r--r--   1 root     root       213 Jun 23  2015 aliases
-rw-r--r--   1 root     root     12288 Jun 23  2015 aliases.db
drwxr-xr-x   2 root     root     16384 Jan 28 09:11 alternatives
drwxr-xr-x   9 root     root      4096 Mar 20 14:01 apache2
drwxr-xr-x   4 root     root      4096 Apr 30 09:15 apparmor.d
drwxr-xr-x   6 root     root      4096 Nov  5  2015 apt
drwxr-xr-x   2 root     root      4096 Mar 20 16:47 awstats
-rw-r--r--   1 root     root      1863 Nov 13  2014 bash.bashrc
drwxr-xr-x   2 root     root      4096 Apr 30 09:15 bash_completion.d
drwxr-sr-x   2 root     bind      4096 Mar 10 09:59 bind
-rw-r--r--   1 root     root       367 May 19  2014 bindresvport.blacklist
drwxr-xr-x   2 root     root      4096 Apr 18  2015 binfmt.d
drwxr-xr-x   3 root     root      4096 May 13  2015 ca-certificates
-rw-r--r--   1 root     root      8668 Jan 28 09:10 ca-certificates.conf
-rw-r--r--   1 root     root      7773 May 13  2015 ca-certificates.conf.dpkg-old
drwxr-xr-x   2 root     root      4096 May 13  2015 calendar
drwxr-xr-x   5 root     root      4096 Jun 23  2015 clamav
drwxr-xr-x   4 root     root      4096 May 13  2015 cloud
drwxr-xr-x   2 root     root      4096 May 13  2015 console-setup
drwxr-xr-x   2 root     root      4096 Apr 30 09:16 cron.d
drwxr-xr-x   2 root     root      4096 Apr  6 22:08 cron.daily
drwxr-xr-x   2 root     root      4096 Sep 10  2015 cron.hourly
drwxr-xr-x   2 root     root      4096 Sep 10  2015 cron.monthly
-rw-r--r--   1 root     root       722 Oct 26  2014 crontab
drwxr-xr-x   2 root     root      4096 Sep 10  2015 cron.weekly
drwxr-xr-x   4 root     root      4096 Sep 10  2015 dbus-1
-rw-r--r--   1 root     root      2969 Mar 19  2015 debconf.conf
-rw-r--r--   1 root     root         4 Mar 14 10:45 debian_version
-rw-r--r--   1 root     root         0 Mar 19  2015 debsums-ignore
drwxr-xr-x   2 root     root      4096 May 16 18:35 default
-rw-r--r--   1 root     root       604 May 16  2012 deluser.conf
drwxr-xr-x   4 root     root      4096 Jan 15 09:21 dhcp
<snipped many more file listings>


You're confusing the root of your home directory with the root of the file system. No matter. Your hosting provider is using the default modsecurity-crs base rules. They need to unblock dokuwiki uploads. example only, your hosting provider likely/should have a per-domain modsec policy (as root):-
echo "SecRuleRemoveById 960010" >> /etc/asl/modsecurity_crs_30_http_policy.conf


That would append a new rule to the modsec policy which will allow safe upload requests for dokuwiki to be allowed.
Speak to the hosting providers support. Show them your logged errors and they should be able to help you.
This post was edited on 2016-05-28, 12:38 by SFITCS.
Edit reason: spelling correction
eilko #11
Member since Feb 2012 · 22 posts
Group memberships: Members
Show profile · Link to this post
it looks like you are using mod_security rules from Atomicorp. Check http://wiki.atomicorp.com/wiki/index.php/Mod_security how to disable a specific rule.  You need to disable rule 960010.  You also might be running mod_security by Plesk 12.5. Then you can disable this rule in the Plesk control panel.
Avatar
SonoDavid2 #12
Member since Mar 2016 · 20 posts · Location: Belgium
Group memberships: Members
Show profile · Link to this post
Subject: FIXED!
It seems like the hosting provider finally woke up and fixed the problem (EDIT: So they disabled the rule which made uploading images impossible). Uploading files is fixed and I'm finally able to upload images without going trough the troublesome ftp uploading process  :-D
Thanks for all the tips and feel free to visit the wiki at http://flowtime.be/dokuwiki/doku.php?id=start
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: 2019-12-06, 09:44:16 (UTC +01:00)