2

How can i submit a form which contains an image and store it in img/orginal folder and then resize it to a few different sizes and store them in img/small img/medium img/large using the CakePHP media plugin or any other plugin.

I just want to know is it possible to upload an image by sending the file to the server and running an action where i can do a little bit of logic and return back and display the image.

Please guide me where i should start.

1

3 Answers 3

1

http://www.uploadify.com/

is fine for jquery. I'm not experienced with cakephp through

Sign up to request clarification or add additional context in comments.

2 Comments

i had a look into that component.. looks awesome. just trying to undeerstand how to implement it in Cake
Put the whole uploadify package in app/webroot/uploadify, paste the Head section into a view and change the script setting to point to a CakePHP controller action that handles the upload..
1

you can always create your own component or you can use a component from the bakery page. I've found this two that might help you

http://bakery.cakephp.org/articles/floorball92/2009/08/02/image-component-for-upload-and-thumbnail-phpthumb

http://bakery.cakephp.org/articles/santoshgroup/2010/10/12/file_upload_restriction_2

Good Luck!

1 Comment

ahhh oops didnt see the "AJAX" in the title.. so you should use a JS uploader like the one mentioned on the other answer, and server side you'll need a component like the ones that i sended you
1

http://bakery.cakephp.org/articles/Warringer/2009/05/08/comfortable-ajaxuploads-with-cakephp

It doesn't work with the latest version of CakePHP, but I think its close to what you need.

[UPDATED, March 13 2012]

Actually, I was looking for something like the above (which is how I stumbled on this Stackoverflow post in the first place), and didn't really find anything that came close to what I was looking for ... so wrote my own Plugin:

https://github.com/srs81/CakePHP-AjaxMultiUpload

All documentation is in the README, and it should just work out of the box on CakePHP 2.0.6 and 2.1.0 (tested on both.) Hope its useful.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.