Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [SOLVED] - Upload Mime check issue

[SOLVED] - Upload Mime check issue 14 Jan 2012 16:38 #995

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
Hi Jocelyn,

I regenerated the component and installed it unaltered on the server of a customer's server. When installing I get the following warnings:
Warning: Call-time pass-by-reference has been deprecated in /home/...ch/joomla17/administrator/components/com_helloworld/controllers/world.php on line 150

Warning: Call-time pass-by-reference has been deprecated in /home/...ch/joomla17/administrator/components/com_helloworld/controllers/world.php on line 157

Here problem one with the file folder does not exist. It is right unter the components name. But here also, I can upload image and doc files, but the extension is not being saved nor displayed. So the error of the missing extensions seems to be persistent.

Well have to check again on localhost and let you know.
The administrator has disabled public write access.

[SOLVED] - Upload Mime check issue 16 Jan 2012 09:16 #1007

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
Hi Jocelyn,
did some more testing about the problems with the mime type checking.
  1. I can easily upload .doc and .pdf files in Joomla 1.7 with either the Joomla Media Manager or the File Manager of the JCE Editor. So, I don’t think, it’s a problem related to the Apache Server, but rather a failing MimeCheck on a Windows 7 x64 system. I know, many developers prefer Linux or Macs, but it has never been a problem using Joomla with Windows.
  2. Before continuing testing on localhost, I uploaded the downloaded and unaltered component to one of my customer’s web-server and tested it there. In the properties of the upload_file field I left the rename field empty (Default: {ALIAS}.{MIMEXT}.
  3. Now, I can upload on a web-server both .doc files and image files, but the files are displayed and saved without extension.
  4. If I add the code snippet [array( 'overwrite' => 'suffix', 'rename' => '{ALIAS}.{MIMEXT}',)))] in the controller.php file in admin as you mentioned in your post, I get the following warning:
  5. Warning: Call-time pass-by-reference has been deprecated in /home/…...ch/joomla17/administrator/components/com_helloworld/controllers/world.php on line 150.
  6. And it does not change anything
  7. So before going on testing, I think this needs to be fixed first.
The administrator has disabled public write access.

[SOLVED] - Upload Mime check issue 24 Jan 2012 17:37 #1049

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Hi giori.
I'm back on the forum !

First, for renaming, use {ALIAS}.{EXT} instead of {ALIAS}.{MIMEXT}
By this way, you can skip the getMime() function.
You have to understand that {MIMEXT} will use the extension after mime detection. So if you skip it you got blank ext. Normal.

{EXT} will reuse the extension of the uploaded file.


Regarding file upload with Joomla :
I'm not sure the Mime is always checked. (Mime-check is not a secure protection. Not really usefull in facts)
What I remember is the mime is controlled ONLY if you forbid some mime types in the configuration. So it is not a generality.

Try to change the glogal configuration (1.5) or the com_media configuration (> 1.6), and setup some 'not-allowed' Mimes. Try to upload again with com_media. (for JCE, I don't looked in the code)


Your generated component uses the same calls of com_media for checking mime. So I'm quite sure the problem is not from Cook.
Coding is now a piece of cake
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.086 seconds

Get Started