Cant get photo to upload. |
The CodeIgniter User Guide shows how to do this.
Do this, otherwise go by the User Guide and start over. PHP Code: // change this 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? Ive found what I think was an error. The working page that has these functions have the following variable with a different name; PHP Code: $drinkphoto = 'mem/'.$lcuser.'/adverts/'.$drink/$img['file_name']; But that did not solve my problem. However, it may lead to a resolution.
Ive found the root of my problem but not solved it.
I am able to upload fwrite data then redirect to photos upload, but the problem with that is if the $product name is omitted or different the fwrite & photos are not together, and that is unsatisfactory. I would prefer to have both in the same operation but that is impossible. The root of that problem is in the view page where the fwrite requires the first coding & the photo upload requires the second, and they are not interchangeable. PHP Code: <?php echo form_open('pagename'); ?> If the $product variable in the fwrite can be transferred to the photos upload, then that could be lived with, but redirect to the finished advert will be required. I would prefer when the photos are uploaded then to redirect to the finished advert, but that is impossible because the photos upload will not redirect. Although I have another operation with a small amount of fwrite plus a pdf document upload and that redirects with no problem. I have spent the last 4 months trying to resolve this issue, probably spent 1,000 hours plus, and still havent achieved a resolution. By the way the coding in the UserGuide detailing uploads is faulty, by undefined variables, but when those variables are deleted it works but not with a combination of fwrite & photo uploads. The problem appears to be a fault within CodeIgniter, so there needs to be someone who understands their coding & be able to fix the problem.
Ive found the problem. When uploading data with photos you must keep separate in form_validation the data from photos. Just make two separate form_validations.
|
Welcome Guest, Not a member yet? Register Sign In |