Koozali.org: home of the SME Server

Obsolete Releases => SME 8.x Contribs => Topic started by: michelandre on December 21, 2012, 08:56:11 PM

Title: MediaWiki "The file you uploaded seems to be empty" (resolved)
Post by: michelandre on December 21, 2012, 08:56:11 PM
Hi all,

I am having a problem with MediaWiki when I try to upload a jpg file or any other file. The message is:

The file you uploaded seems to be empty. This might be due to a typo in the filename. Please check whether you really want to upload this file.

All the rest is working properly

I am using a virtual machine. SME 8.0 fully updated, lot of RAM and DISK space etc. I use InnoDB engine for all of them.

I have another VM exactly the same except for the root directory. On one VM, it is in Primary/html/Wiki_Test/core and on the other it is in Primary/html/wiki. Absolutely all is the same in the directories; owner, group, rights...
I cloned the working one and changed the directory to be Primary/html/wiki and the IP address, I ajusted LocalSettings.php to take care of the new IP and root directry. All worked.
I made a brand new VM, update or not, and still the same problem.
I scp the working one to a new one, changed owner and group to be the same as on the original, and still the same problem.
Both /etc/php.ini are exactly the same.
When I login in MediaWiki, I see a file in /tmp, so the pointer to the tmp dir is good.

I tried images/ with 777 etc..

I checked the LocalSettings.php, both exactly the same (except for root directory).

I search google for a long time, tried all kind of stuff, etc...

Now I think it is something with SME but do not know what.

********************
LocalSettings.php
********************
# Limite de taille de fichier, ici 20MB
$wgMaxUploadSize = 1024*1024*20;

# Doit-on vérifier l'extension du nom de fichier à l'upload? oui
$wgCheckFileExtensions = true;

# Les extensions autorisées
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'psd', 'mp3', 'xls', 'xlsx', 'swf', 'doc','docx', 'odt', 'odc', 'odp', 'odg', 'mpp');

# Les extensions spécifiquement interdites
# HTML may contain cookie-stealing JavaScript and web bugs
# PHP scripts may execute arbitrary code on the server
# Other types that may be interpreted by some servers
# May contain harmful executables for Windows victims
$wgFileBlacklist = array( 'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' );
********************

Any help will be very appreciated,

Thank you all

Michel-André

Title: Re: MediaWiki "The file you uploaded seems to be empty"
Post by: guest22 on December 22, 2012, 09:49:56 AM
Hi,

maybe this will give you some guidance. http://wiki.contribs.org/User_talk:Calisun

use 'db accounts show [ibayname]' to see the various SME settings for an iBay

Regards,
guest
Title: Re: MediaWiki "The file you uploaded seems to be empty"
Post by: michelandre on December 22, 2012, 12:03:02 PM
Hi HF,

You're the Greatest,

I woke up in the middle of the night from a nightmare about the problem.
I went for some water.
Passing by the computers, I saw a message. Read it and Bingo, problem solved.

Tomorrow (this morning) I will write how your 'db accounts show [ibayname]' single line saved my 2 weeks of trying all kind of stuff.

Thank you again Greatest,

Michel-André   :grin: :grin: :grin:
Title: Re: MediaWiki "The file you uploaded seems to be empty"
Post by: guest22 on December 22, 2012, 01:23:03 PM
Glad it worked out for you.

Please see this page: http://wiki.contribs.org/DB_Variables_Configuration for more db commands regarding SME Server specific php settings per Ibay.

The 'db' system itself is explained here: http://wiki.contribs.org/Db_command_tutorial

and here is a shortcut to the reason why 'db' and 'templates' are used at all: http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Architecture_overview

Regards,
guest
Title: Re: MediaWiki "The file you uploaded seems to be empty"
Post by: michelandre on December 22, 2012, 01:39:59 PM
Hi HF,

Cannot sleep, playing with MediaWiki. I have to rest before I drop...

The things I always wanted to study in details.
I will look at them carefully.

The next thing will be why admin:shared.
I think I will see why when I look at those links.
Now, I have quite a lot of marvelous study on my plate.

99% of the job was done with 1% of the work.

Again, thank you so much for that single line,

Michel-André
Title: Re: MediaWiki "The file you uploaded seems to be empty"
Post by: guest22 on December 22, 2012, 02:06:07 PM
For your 'next thing', search the forums for 'ibay permissons'
Title: Re: MediaWiki "The file you uploaded seems to be empty" (Resolved)
Post by: michelandre on December 22, 2012, 08:42:30 PM
When HF wrote 'db accounts show [ibayname]' I tried it and it gave me:

Primary=ibay
    CgiBin=enabled
    Group=shared
    Modifiable=no
    Name=Primary i-bay
    PHPBaseDir=/home/e-smith/files/ibays/Primary:/tmp
    PasswordSet=no
    Passwordable=no
    PublicAccess=global
    Removable=no
    UserAccess=wr-admin-rd-group

The VM that didn't work didn't have that line. In my 2 weeks of googling I tried so much stuff that I didn't remember I did that command on the working VM.

It was in the middle of the night when I saw the message of HF. I looked in history, /etc/php.ini, /home/e-smith/files/users/admin/, in all the i-bays, etc...

Google is your friend. After half an hour I search again for PHPBaseDir on Google. When I saw "wiki.contribs.org/PHP" in the first result I went to that site then I remembered... What a night(mare)... I should have gone directly to Google after HF's message. The morale of the story: "It's simple and obvious... AFTER".

To set up the /tmp directory:
db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary:/tmp

Your best friend is not Google, it's Google in SME forum,

Michel-André