FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Trying to upload mp3 but giving error #472

Closed justcharlz closed 7 years ago

justcharlz commented 7 years ago

Hello. Don't know if someone else has encountered this issue. I tried uploading an mp3 file but it gives an error. the file name is always empty hence it the database throws error of empty field.

josegonzalez commented 7 years ago

What is the error you are seeing? Can you provide the following?

Do not redact any of that information - except to remove any hardcoded secrets, replace those with XXXXX - we want it as is.

justcharlz commented 7 years ago

hello. The error I am getting is that the field "beat name" doesn't have a default value. see printscr error here: http://prntscr.com/gycugb Created a gist of the codes here https://gist.github.com/charlie4biz/f4e798c6a288e19afcc5919c6dfb78f2 thank you

josegonzalez commented 7 years ago

Can you try clearing your app cache and trying again?

justcharlz commented 7 years ago

Still same issue. It works perfectly for images but not for audio files like mp3.

josegonzalez commented 7 years ago

You're getting an error of 1, which means you're uploading files larger than the max file size. Here is a map of those errors: https://secure.php.net/manual/en/features.file-upload.errors.php

You'll need to add a validation rule on max file size to surface the error - we don't auto-add validation rules, by design - and also increase that number if you want to be able to upload the files.