2010-10-29 65 views
0

如果我使用绝对网址,我会将图片上传到文件夹。 但如何使用绝对网址?Codeignitor查看网址?

function do_upload() $ config ['upload_path'] ='upload /'; $ config ['allowed_types'] ='gif | jpg | png'; $ config ['max_size'] ='100'; $ config ['max_width'] ='1024'; $ config ['max_height'] ='768';

$ this-> load-> library('upload',$ config);如果(!$ this-> upload-> do_upload()) { $ error = array('error'=> $ this-> upload-> display_errors());

$ this-> load-> view('upload_form',$ error); } else {data = array('upload_data'=> $ this-> upload-> data());

$ this-> load-> view('upload_success',$ data); } }

以上是我的控制器代码。 我尝试上传,但我无法判断文件夹应位于哪个路径?它应该在根目录还是在控制器中还是在视图中?

回答

0

它应该在根。

+0

谢谢,我明白了。 – user490905 2010-11-01 02:53:57