开发者

kohana 3 uploading image without using any modules?

does anybody have an example of uploading images in kohana 3 without using any modules eventually ?

i used https://github.com/kohana/image/tree/3.1%2Fmaster but my error is: Fatal error: Uncaught Kohana_Exception [ 0 ]: Installed GD does not support images

is there any easy and fast way to upload files in a koha开发者_如何学JAVAna 3 based website?

thanks!


Kohana API should help.

Basic steps are:

  1. Create Validation object ($array = Validation::factory($_FILES);)
  2. Define rules ($array->rule('file', 'Upload::not_empty')->rule('file', 'Upload::type', array(array('jpg', 'png', 'gif')));)
  3. Check file(s) (if ($array->check()))
  4. And save it ($filepath = Upload::save($_FILES['file'], 'uploaded_file', 'upload_dir');)


This will help you :)

http://forum.kohanaframework.org/discussion/6988/ko3-k03-image-library-installed-gd-does-not-support-images/p1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜