Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] upload an mp3

[SOLVED] upload an mp3 problems 27 Jun 2013 21:02 #7729

  • cliffordsean
  • cliffordsean's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 1
  • Karma: 1
hi im using jcook 2.5 and im trying to usse the file uploader to upload mp3 and ogg files but no matter what i do i cannot

1) screencast.com/t/NlSkyB6vkIsf
2) despite having this checked : screencast.com/t/UEZx3XGJe but when i try to upload .ogg file i get screencast.com/t/Ma0srLe0F9v

any ideas please ?
tnx
sean
Last Edit: 28 Jun 2013 18:25 by BTB300.
The administrator has disabled public write access.

upload an mp3 problems 28 Jun 2013 12:21 #7735

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 414
  • Thank you received: 130
  • Karma: 46
Did you happen define the MIME Type (i guess it needs to be edited in your component after download)
Was not available in Cook < 2.5 and i guess its still a work in progress
also unsure if there is any further (more extensive) MIME checks on audio files

- The MIME type column for MP3 etc is incomplete in the properties box / the selection is white
- the working file MIMEs are green

I did post a long time ago a list of valid audio related mime types

www.j-cook.net/index.php/forum/design-yo...d-configuration#1303

LOCAL or SANDBOX UPLOAD
if it works in sand box check your php.ini
i had a similar issue in php 5.5.4
extension=php_fileinfo.dll was commented out
The administrator has disabled public write access.
The following user(s) said Thank You: Pantelis

upload an mp3 problems 28 Jun 2013 12:53 #7736

  • cliffordsean
  • cliffordsean's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 1
  • Karma: 1
great thanks for reply


can anyone tell me where in the code i could comment out completely the file type check please ?
The administrator has disabled public write access.

upload an mp3 problems 28 Jun 2013 16:57 #7737

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 414
  • Thank you received: 130
  • Karma: 46
I don't need to tell anyone here that it is never advisable to disable file validation procedures

The following advice is provided for testing / workaround purposes only.

DO NOT DISABLE THIS ON A PRODUCTION SITE

I am not responsible for issues arising from or caused by modification if you choose to comment out the checkMime function

That said you will find it here ;)
protected function checkMime($fileMime) in upload.php

bypass the check mime function for AUDIO file types only (if your component uses other MIME types)

if you intend to use it for a production site
- personally i suggest you do not rely on Cook alone to provide MIME validation
- Google and implement a stronger Audio File validation using the fork

and one final note
remember MIME validation issues can also be browser, server or client specific

Anyhow hope it helps
Last Edit: 28 Jun 2013 16:58 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

upload an mp3 problems 28 Jun 2013 17:19 #7738

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Regex and Mimes are only given as example.

BTW, Mime validation is not a security check. It is only for ergonomy and handling common errors.

File mimes can be edited with a hexadecimal editor, so it is possible to put another mime type on the file to pass the check. I never tried but it is obvious to me that the security must be handled differently.
Coding is now a piece of cake
The administrator has disabled public write access.

upload an mp3 problems 28 Jun 2013 17:34 #7739

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 414
  • Thank you received: 130
  • Karma: 46
Hey There

Your MIME TYPE FOR m4a looks incorrect
mime=audio/mp4a-latm
extension=m4a
in both columns you have m4a

AND
in The file validation error that you linked to shows that big strong man.ogg has been identified as an video/mp4


rather than disable the check mime

try as a workaround for now
mime = video/mp4 extension=ogg
from a Google search i believe its application/ogg not audio/ogg

start here MIME TYPES LIST

Finally remember that even though its extension indicates that it is one thing your browser, server or client may identify it as something else
Last Edit: 28 Jun 2013 18:39 by BTB300.
The administrator has disabled public write access.

[SOLVED] upload an mp3 problems 28 Jun 2013 18:18 #7741

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 414
  • Thank you received: 130
  • Karma: 46
You can upload Audio files and any other file types using COOK
- All you have to do is provide the correct MIME Type and Extension of the file type your uploading

Generally issues with upload from my experience are not related to COOK but to other factors such as
- Server configuration
- Directory permissions
- Browser related issues
- incorrect file extensions (wolves in sheep's clothing)

OK to Close Ticket?
Last Edit: 28 Jun 2013 18:35 by BTB300.
The administrator has disabled public write access.
Time to create page: 0.109 seconds

Get Started