Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Problems with file upload

Problems with file upload 11 Jul 2016 07:55 #14202

  • pbianco
  • pbianco's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
Hi,
in my application the user can upload a gpx file.
It worked perfectly with the old version, with the new version it returns an error "Mime type not valid".
Can you, please, help me to solve this?

My project is Club4000 - Table Dettaglio salite soci - View dettagliosalitesociitem, layout=nuovasalita

Thanks
The administrator has disabled public write access.

Problems with file upload 11 Jul 2016 12:46 #14203

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi Chef,

I'm also having problems with File upload. In my case the file upload won't upload a pdf (when the properties for the field allow it).

The Error says :
"This file extension (pdf) is not accepted, the accepted files are : jpg,png,gif"

(I posted a topic here... www.j-cook.pro/index.php/forum/14-news-c...-file-uploads-images )
Just call me Chris :)
The administrator has disabled public write access.

Problems with file upload 13 Jul 2016 15:49 #14232

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi Chef,

I guess you are pretty busy - but this particular bug is killing me - its holding up two projects of mine that I need to get out.

Hope you can find the time to take a look soon.

(No rush for the other stuff).

Cheers
Just call me Chris :)
The administrator has disabled public write access.

Problems with file upload 14 Jul 2016 04:02 #14238

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
OK - there were some checkboxes hidden for me.

With Chrome and Firefox you will see this...


You need to drag out the dialogue box to see the checkboxes...


I now have an error which is similar to pbianco...
"Mime type not valid (application/force-download), allowed Mimes are image/jpeg - image/png - image/gif - application/pdf - image/jpeg - application/msword : "

I don't get this error in the sandbox. It is only on my server.

So its probably a php/apache configuration - as my server is locked down tight for security. I have certain functions disabled like shell_exec.

Does anyone have any clues to which server/php functions the file upload uses? (I'm still trawling through the forum)
Just call me Chris :)
The administrator has disabled public write access.

Problems with file upload 14 Jul 2016 04:52 #14239

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Chef has documentation on MIME here...
http://www.j-cook.pro/index.php/m/mime-type

But this document is out of date. classes / file / upload.php does not exist anymore - as per Chef's announcement here
www.j-cook.pro/index.php/docs/versions/226-2-9

Somebody need to update the documentation :whistle:

I'm going through administrator/components/com_####/helpers/file.php trying to work it out.

Looks like there is relevant code on line 1925...
public static function uploadFile($dir, $uploadFile, $options = array())	{
....
$checkMime = $config->get('upload_check_mime', true);

Just after that, you can hack the code...
//hack
$checkMime = false;

But there might be a better way. The function is looking at a configuration setting somewhere. Does anyone know where that is?
Just call me Chris :)
Last Edit: 14 Jul 2016 05:04 by organicwebs.
The administrator has disabled public write access.

Problems with file upload 14 Jul 2016 08:53 #14241

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Thanks, I will check all this as soon as possible and give you an answer, update the docs...
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs

Problems with file upload 14 Jul 2016 21:45 #14248

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
EDIT : The graphical problem has been fixed.


I created an option in your component to toggle the mime-detection.
I updated the docs : www.j-cook.pro/index.php/m/mime-type
Coding is now a piece of cake
Last Edit: 14 Jul 2016 21:48 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs
Time to create page: 0.125 seconds

Get Started