# |
Feb 8th 2018, 16:13 |
neon1024 |
So makes sense for our use-case |
# |
Feb 8th 2018, 16:13 |
neon1024 |
It’s for our API, so we don’t need to serve out all the various sizes to our client websites via our api and from our api server |
# |
Feb 8th 2018, 16:11 |
spencdev |
It’s kind of pricey, but I can imagine the time this would save on a lot of use cases |
# |
Feb 8th 2018, 16:08 |
neon1024 |
My boss sure likes it |
# |
Feb 8th 2018, 16:08 |
spencdev |
that is actually really freaking awesome |
# |
Feb 8th 2018, 16:07 |
spencdev |
whoa |
# |
Feb 8th 2018, 16:06 |
spencdev |
I’ve never heard of it, looking it up now |
# |
Feb 8th 2018, 16:06 |
neon1024 |
Thankfully with Imgix we just need a single source image and Imgix will create any requested variants on the fly |
# |
Feb 8th 2018, 16:05 |
neon1024 |
Yes, we’ll be using a similar system as I understand it. |
# |
Feb 8th 2018, 16:05 |
spencdev |
The downside of that is, if I ever have to manually look for a file in S3 with out access to the database to see the associated filename, I’m kind of out of luck considering there are 17gb of files saved... |
# |
Feb 8th 2018, 16:03 |
spencdev |
The user doesn’t interact with anything saving except for the files name, which if I remember right (i’m on my phone), it verifies the name is acceptable before ever even trying to save. For S3, the name is tokenized. The name of the file actually doesn’t have anything to do with where/what it’s being saved as. I think I got the idea from one of the upload plugins. |
# |
Feb 8th 2018, 15:59 |
neon1024 |
Wont you end up with images in storage you’re not using though? |
# |
Feb 8th 2018, 15:58 |
spencdev |
Don’t get me wrong, I used AWS sdk, but the class interacts with it instead of the models. The models use the class. I do it the other way around though, I make sure the image saves to S3 before saving to the db. |
# |
Feb 8th 2018, 15:57 |
spencdev |
I wrote my own class for S3 uploads because a lot of models interact with S3 and straight into the model just looks awful. |
# |
Feb 8th 2018, 15:56 |
neon1024 |
I’m yet to start with S3, but it’s on my list of things to do. As we want to implement Imgix as well |
# |
Feb 8th 2018, 15:56 |
neon1024 |
But either way :slightly_smiling_face: |
# |
Feb 8th 2018, 15:56 |
neon1024 |
Well I bet you could easily wrap that in a Writer class |
# |
Feb 8th 2018, 15:55 |
amit |
And I am using there lib to upload file |
# |
Feb 8th 2018, 15:55 |
amit |
@neon I am uploading a file on VPS ObjectStore, which is similar like AWS S3 |
# |
Feb 8th 2018, 15:54 |
spencdev |
S3 saves lives |
# |
Feb 8th 2018, 15:53 |
neon1024 |
Unless you’re working on the VPS and saving locally |
# |
Feb 8th 2018, 15:52 |
neon1024 |
So you probably want to use the Friendsofcake/Upload plugin and create your own writer class |
# |
Feb 8th 2018, 15:52 |
amit |
I am uploading the file on Opencloud's VPS |
# |
Feb 8th 2018, 15:51 |
neon1024 |
As an author of one of those upload plugins I’d recommend that :P |
# |
Feb 8th 2018, 15:51 |
neon1024 |
Or you could implement one of the plugins where this has been done for you ;) |
# |
Feb 8th 2018, 15:51 |
neon1024 |
There is also afterSaveCommit if I remember, which you might want to use to ensure the transaction isn’t rolled back |
# |
Feb 8th 2018, 15:50 |
neon1024 |
https://github.com/FriendsOfCake/awesome-cakephp#files |
# |
Feb 8th 2018, 15:50 |
neon1024 |
@amit I would recommend uploading the file in the afterSave event, as other upload plugins do |
# |
Feb 8th 2018, 15:46 |
amit |
@neon1024 So I need to validate the data and then upload file |
# |
Feb 8th 2018, 15:42 |
kevin |
eh ill deal with it later |
# |
Feb 8th 2018, 15:41 |
neon1024 |
Not sure sorry, I don’t use a plugin for it |
# |
Feb 8th 2018, 15:40 |
kevin |
yes I signed up for that one, but do I do recaptcha v2 or invisible recaptcha? |
# |
Feb 8th 2018, 15:40 |
neon1024 |
@kevin This one? https://www.google.com/recaptcha/intro/ |
# |
Feb 8th 2018, 15:40 |
kevin |
the recaptcha isnt displayign, and im getting no errros |
# |
Feb 8th 2018, 15:39 |
neon1024 |
@amit Well that’s odd, as validation happens before you save. |
# |
Feb 8th 2018, 15:39 |
kevin |
yeah so thats what im using, but I think maybe I didnt sign up for the right recaptcha? |
# |
Feb 8th 2018, 15:39 |
neon1024 |
@kevin Sure thing, try out https://github.com/agiletechvn/Recaptcha |
# |
Feb 8th 2018, 15:38 |
kevin |
has anyone implemented recaptcha on their cakephp site before? |
# |
Feb 8th 2018, 15:35 |
amit |
I am uploading images but the problem is the file is upload and when I save the file name in the db I am getting validation error So I want to upload the image only after validation successfully |
# |
Feb 8th 2018, 15:35 |
neon1024 |
Ah well, if you spotted the missing `s` you win a prize. |
# |
Feb 8th 2018, 15:34 |
neon1024 |
More to the point, why doesn’t my route match? https://gist.github.com/davidyell/bb392b553e7e466fd2317bf6996cc12f |