hongkhanh / cropbox

A lightweight and simple JavaScript, Jquery, YUI plugin to crop your avatar
http://hongkhanh.github.io/cropbox/
MIT License
266 stars 99 forks source link

Upload crop result #4

Open nbaxley opened 9 years ago

nbaxley commented 9 years ago

This is a great tool. Very simple and easy to use.

Is it possible to upload the resulting cropped image? I have a script that can accept the file, but need a way to inject it into a form field to be uploaded.

hongkhanh commented 9 years ago

Hi,

Just call getDataURL (a base64 type acts as src of image) or getBlob (support blob) function depend on how you handle file from server. you can refer http://www.nickdesteffen.com/blog/file-uploading-over-ajax-using-html5

Cheers,

Ahmadrameen commented 9 years ago

It was so simple and easy. The problem that i face is how to upload the cropped image to the user folder based on their ids from MySQL database, for example john has id 5 and i need when he uploaded an image so then the image should be stored in an already created folder by the name of its id.

Also how to save the latest uploaded image URL of him in the MySQL database in _avatarimage column.

chalchis commented 9 years ago

Is there any example of how to save the image on the server with php?