# |
Jan 22nd 2020, 22:49 |
ndm |
You are validating the `foto1` field as a scalar, which fails because the uploaded file object isn't a scalar value. I'm not familiar with that plugin, but it seems that it you have to care about handling the upload kinda yourself: https://github.com/josbeir/cakephp-filesystem#simple-upload-example Generally to avoid such problems with uploads, people usually use a separate field for the upload, one wich will have actual upload validation rules, |
# |
Jan 22nd 2020, 22:44 |
luizcmarin |
Perhaps some more information will help. I'm trying to use https://github.com/josbeir/cakephp-filesystem to make uoploads of images. But it's hard ... |
# |
Jan 22nd 2020, 22:39 |
luizcmarin |
does anyone know anything about this type of error? |
# |
Jan 22nd 2020, 22:13 |
luizcmarin |
I have a type => 'File' field for uploading an image. It is mysql, varchar (255). I am now getting the "Object of class Laminas \ Diactoros \ UploadedFile error could not be converted to string." What type should be used in the database? I installed the plugin https://github.com/josbeir/cakephp-filesystem. |
# |
Jan 22nd 2020, 20:24 |
challgren |
Install the suggestions if your going to use them such as storing them in a cloud provider |
# |
Jan 22nd 2020, 20:23 |
luizcmarin |
@challgren install suggests ? |
# |
Jan 22nd 2020, 20:21 |
luizcmarin |
I hope it is easy to use... |
# |
Jan 22nd 2020, 20:19 |
challgren |
`composer require josbeir/cakephp-filesystem` |
# |
Jan 22nd 2020, 20:19 |
challgren |
Yes release 2.0.1 |
# |
Jan 22nd 2020, 20:18 |
luizcmarin |
https://github.com/josbeir/cakephp-filesystem :+1: I will follow here. Right? |
# |
Jan 22nd 2020, 20:17 |
luizcmarin |
:man-facepalming: |
# |
Jan 22nd 2020, 20:17 |
luizcmarin |
I didn't translate your message correctly ... |
# |
Jan 22nd 2020, 20:17 |
challgren |
Only the plugins with :strawberry: are cake 4 comp |
# |
Jan 22nd 2020, 20:16 |
challgren |
https://cakesf.slack.com/archives/C053DPNGT/p1579654134254800 |
# |
Jan 22nd 2020, 20:15 |
luizcmarin |
@challgren |
# |
Jan 22nd 2020, 20:15 |
luizcmarin |
and there is only this 'master' |
# |
Jan 22nd 2020, 20:15 |
luizcmarin |
yea. I followed your link and got this |
# |
Jan 22nd 2020, 20:13 |
challgren |
The friendsofcake/awesome list has good plugins that are cake 4 ready |
# |
Jan 22nd 2020, 20:12 |
luizcmarin |
ops moment |
# |
Jan 22nd 2020, 20:12 |
challgren |
@luizcmarin why are you using a 3 plugin with cake 4? |
# |
Jan 22nd 2020, 20:10 |
luizcmarin |
I will change this to start |
# |
Jan 22nd 2020, 20:09 |
luizcmarin |
https://github.com/Xety/Cake3-Upload |
# |
Jan 22nd 2020, 20:09 |
ricksaccous |
are you using a plugin or writing file handling on your own? |
# |
Jan 22nd 2020, 20:09 |
ricksaccous |
make sure you can reference it |
# |
Jan 22nd 2020, 20:08 |
ricksaccous |
@luizcmarin generally you want to store the name of the file (maybe filesize/mimetype) and then move the file into a local directory |
# |
Jan 22nd 2020, 20:07 |
luizcmarin |
I'm trying to upload my first files. The fields are varchar (255) (mysql). It returns the image error. As I said, it is my first test and I do not know how to solve this type of error. Please, any guidance? |
# |
Jan 22nd 2020, 19:48 |
FredSavagely |
Oh, looks like you might be right: https://github.com/cakephp/authentication/blob/master/src/View/Helper/IdentityHelper.php |
# |
Jan 22nd 2020, 19:46 |
ndm |
Views have access to the request via `$this->request` too |
# |
Jan 22nd 2020, 19:43 |
ricksaccous |
you might as well do that, i think they had an identity helper |
# |
Jan 22nd 2020, 19:42 |
FredSavagely |
Like, assign the response of `$this->request->getAttribute('identity')` to the view? |
# |
Jan 22nd 2020, 19:42 |
FredSavagely |
Do I just need to assign the identity to the view and then use that to check? |
# |
Jan 22nd 2020, 19:41 |
ricksaccous |
they have that but if it doesn't have what you want then you should figure out a way to handle it on your own |
# |
Jan 22nd 2020, 19:41 |
ricksaccous |
https://book.cakephp.org/authorization/2/en/middleware.html#identity-decorator |
# |
Jan 22nd 2020, 19:40 |
ricksaccous |
oh, within the view... |
# |
Jan 22nd 2020, 19:40 |
ricksaccous |
https://github.com/cakephp/authorization |
# |
Jan 22nd 2020, 19:39 |
ricksaccous |
yeah, there's docs for the authorization plugin |
# |
Jan 22nd 2020, 19:37 |
FredSavagely |
Is there a resource somewhere that can show me how to use authorization within the view in CakePHP 4? |
# |
Jan 22nd 2020, 17:56 |
jslamka5685 |
I am already ordering the query. I will make sure I am not overlooking something |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
show what you're attempting if you want |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
or you can simply ->order() the query you are paginating |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
you can set it in the paginator settings via 'order' |