Thumbnail-component-for-CakePHP icon indicating copy to clipboard operation
Thumbnail-component-for-CakePHP copied to clipboard

keep image's initial name

Open davo3 opened this issue 11 years ago • 2 comments

Thanks for the component !!

I was wondering if there is a way to save the initial image's name, and in case if it already exists - add some number after it. I think it would be better, rather than having an image name like this 51d3f648-fb08-404b-81c3-13c06ce302c7.jpg

Thanks!!

davo3 avatar Jul 03 '13 10:07 davo3

Hi! I'm not developing this anymore (lost track of CakePHP versions and changes), but you should be able to tap on that functionality here: https://github.com/tute/Thumbnail-component-for-CakePHP/blob/master/attachment.php#L93

Could be a boolean option: mask original file names or not.

Thanks for the feedback!

tute avatar Jul 03 '13 10:07 tute

Sorry to bother you with my question, but this is bugging my mind…

Is there any way to use your thumbnail component from other mode than the calling model? For example in the example application PET –model is using the component and the data is saved to that model.

I have a situation, where my model that uses component is called IMAGE and I would like to save images from COLLABORATION –model. This is because when I save collaboration messages, I would like to save image (and it’s different versions) as well in the same controller. I seem not to find the right format of the code to save data, Cake always says “Undefined index: collaboration” when I call it this way:

$this->Attachment->upload($this->request->data['Collaboration']);

Also calling this way won’t work (naturally):

$this->Attachment->upload($this->request->data['Image']);

Is there any discussions around this or blog that I could ask these questions from community?

Thanks,

jalpertti avatar Nov 27 '14 13:11 jalpertti