Upload problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Upload problem (/showthread.php?tid=22727) |
Upload problem - El Forum - 09-18-2009 [eluser]Gazzhop[/eluser] view: Code: <?php echo form_open_multipart('image_manager/do_upload');?> controller Code: <?php MY_Url_helper Code: if ( ! function_exists('file_url')) PROBLEM: I keep getting path invalid error, but can't see what i'm doing wrong. Sorry if this is simple noob problem. Upload problem - El Forum - 09-19-2009 [eluser]gunter[/eluser] Code: $config['upload_path'] = 'http://localhost:8888/PDCRARE/images/'; bad boy! you cannot use a http: adress as upload path... instead use something like... Code: "./PDCRARE/images/" normally, if you are using this: Code: $config['upload_path'] = './uploads/'; Upload problem - El Forum - 09-19-2009 [eluser]NateL[/eluser] Yeah you need your document root. You can find it by using this code: Code: <?php echo $_SERVER['DOCUMENT_ROOT']; ?> Upload problem - El Forum - 09-21-2009 [eluser]Gazzhop[/eluser] I have added the code Code: echo $_SERVER['DOCUMENT_ROOT']; and it brings up /var/www/html so I add /CMS_PDCRARE/images/ as the directory path and chmod 777 the images directory. But still gets the error. tried ./ as the directory path and I get the success page but image not uploaded anywhere. I must be doing something stupidly wrong but can't fathom what it is!!! Upload problem - El Forum - 09-21-2009 [eluser]IkoTikashi[/eluser] You need the full path: /var/www/html/CMS_PDCRARE/images/. To be on the save side when you switch servers, use Code: "{$_SERVER['DOCUMENT_ROOT']}/CMS_PDCRARE/images/" Upload problem - El Forum - 09-22-2009 [eluser]Gazzhop[/eluser] Solved! thanks, I have another question: in /var/www/html I have two sites main and the CMS. I have created a form and want to dump out the images in the main site's image folder into options (so they can be assigned). But when I use Code: $this->load->helper('directory'); view Code: foreach($pics as $row){ I get no options, what have I done wrong? |