开发者

How to let users store multiple size images in cakephp environment?

Im building a mobile app for android & ios using appcelerator. I've build a rest server using cakephp which returns json开发者_StackOverflow社区. I would like to know how i could make it possible that users upload a image to a server and the server resizes this picture to 2 different standard sizes and stores them on the server. This image should be accessible trough a json get request along side with other corresponding information. My questions are

How can i autimatically resize pictures that are uplouded by users in to two standard sizes and how can i store these images(in folders or DB) so they are accessible through json alongside their other corresponding infomation?


for the resizing, just google "php resize image". Store the images in some folder in webroot/img folder and store the file name in the db. You might need to rename the file in case there's another file with the same name. When requested, just give the users the url to your image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜