Cant get photo to upload. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Cant get photo to upload. (/showthread.php?tid=77675) Pages:
1
2
|
Cant get photo to upload. - christaliise - 10-02-2020 Im trying to create an advert template but can not get the photos to upload. I dont receive any errors. Ive simplified the coding so that it focuses only on the uploading of one photo, as follows; This is the Controller coding; PHP Code: public function drinkadvert() PHP Code: <?php The remedy to this problem must be simple. Can anybody tell me what it is? RE: Cant get photo to upload. - InsiteFX - 10-02-2020 Try this and see if it works. PHP Code: $config['upload_path'] = './mem/'.$lcuser.'/adverts/'.$drink; Remember the path for the file has to have write access also. RE: Cant get photo to upload. - christaliise - 10-03-2020 (10-02-2020, 06:56 PM)InsiteFX Wrote: Try this and see if it works. Nope, that made no difference, but thanks. Im getting desperate. RE: Cant get photo to upload. - InsiteFX - 10-03-2020 You can try giving it the Absolute path or relative path. As it is now I would try them both. You did not mention if this was running on localhost or a live server? Also what OS are you running? RE: Cant get photo to upload. - christaliise - 10-03-2020 (10-03-2020, 02:40 AM)InsiteFX Wrote: You can try giving it the Absolute path or relative path. I guess you mean "position:" in the view page. Ive had it on "fixed" but "relative" & "absolute" make no difference. Running localhost. OS Windows. Ive tried backslash \ separator on one page a while ago & it didnt work. The coding Ive provided, including the forward slash separators /, has worked OK on other pages. RE: Cant get photo to upload. - christaliise - 10-03-2020 (10-03-2020, 02:40 AM)InsiteFX Wrote: You can try giving it the Absolute path or relative path. Ive just tried; PHP Code: $config['upload_path'] = 'mem/'.$lcuser.$drink; PHP Code: $config['upload_path'] = 'mem/'.$drink; RE: Cant get photo to upload. - InsiteFX - 10-03-2020 I think I see what is wrong now in your form_open you only have the function name it should be controller/function your missing the controller name controller/function ( method ). RE: Cant get photo to upload. - christaliise - 10-03-2020 (10-03-2020, 07:20 AM)InsiteFX Wrote: I think I see what is wrong now in your form_open you only have the function name I dont understand. Do you mean "public function drinkadvert()" must be the same name "drinkadvert" <?php echo form_open_multipart('drinkadvert'); ?> They are the same. RE: Cant get photo to upload. - InsiteFX - 10-03-2020 What is the name of the controller that the function is in? PHP Code: <?php echo form_open_multipart('controllerName/drinkadvert'); ?> Change controllerName to the name of your controller that the drinkadvert is in. RE: Cant get photo to upload. - christaliise - 10-03-2020 (10-03-2020, 10:20 AM)InsiteFX Wrote: What is the name of the controller that the function is in? I had the Controller name shortened by $route. But I tried it the long way & still did not upload. When that name is incorrect it gives an error but Im not getting any errors. |