kohana 3 uploading image without using any modules?

妖精的绣舞 提交于 2020-01-01 19:55:13

问题


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 kohana 3 based website?

thanks!


回答1:


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');)



回答2:


This will help you :)

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



来源:https://stackoverflow.com/questions/5430449/kohana-3-uploading-image-without-using-any-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!