Cant get photo to upload. |
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?
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
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? What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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.
(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;
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 ). What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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.
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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. |
Welcome Guest, Not a member yet? Register Sign In |