2010-10-29 64 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