FriendsOfCake / cakephp-upload

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

Saving correctly, but not uploading the image. #488

Closed pmoraes closed 6 years ago

pmoraes commented 6 years ago

Hey guys.

This is my first time using this plugin.

I'm not sure if this is a bug or a mistake mine. Probably its a my mistake.

What is happening. Its saving perfectly, the image name is in the photo field. Everything looks ok.

But the file is not uploaded to the folder. I'm using the basic example.

I have permissions to the folder. Anyone can know what is happening?

This is behavior code

$this->addBehavior('Josegonzalez/Upload.Upload', [ 'photo' => [] ]);

dreamingmind commented 6 years ago

Two quick things to check, 1 - do the permissions allow writing to your destination folder 2 - is the picture too big. I remember my first attempts silently failing when the picture was past a size limit (can't remember the limit). I believe this limit was something set in php.ini, but again—a while ago; working from memory

pmoraes commented 6 years ago

both were checked and they are correct.

josegonzalez commented 6 years ago

Can you gist your .ctp file?

pmoraes commented 6 years ago

https://gist.github.com/pmoraes/a918bdfd818af7524f5c9179e5bd2e87

josegonzalez commented 6 years ago

Where do you expect the files to be saved on disk?

pmoraes commented 6 years ago

webroot/img/Tips/photo

josegonzalez commented 6 years ago

Why do you expect that path? Thats not the default configuration.

By default, we upload to:

webroot{DS}files{DS}{model}{DS}{field}{DS}

As specified by the path config option here: http://cakephp-upload.readthedocs.io/en/latest/configuration.html

pmoraes commented 6 years ago

yes.. this was totally my fault.. I didnt see this in the configuration. Thanks for your time.