![]() |
GD library works on one form but not the other - 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: GD library works on one form but not the other (/showthread.php?tid=28097) |
GD library works on one form but not the other - El Forum - 03-01-2010 [eluser]geekindisguise[/eluser] I used a tutorial that uploaded images resized them. That all works great! And it uses the GD2 library. Now the problem: I made another app that will upload images the SAME WAY but also add the rest of the form to a database. It adds to the database just fine. But it says the GD function is not supported. Both pages are on the same server. Why doesn't it work? I used the exact code from the working app to use with my new one. I don't get it. To view the Working one: http://jacobwilmoth.com/users/CI/ And the NON-Working one: http://jacobwilmoth.com/users/CI/BroJews-CI/ MY MODEL: Code: <?php The CONTROLLER: Code: <?php And the VIEW: Code: <html> GD library works on one form but not the other - El Forum - 03-02-2010 [eluser]xeroblast[/eluser] use this in your view: from: <?php echo form_open('site/create'); ?> to: <?php echo form_open_multipart('site/create'); ?> GD library works on one form but not the other - El Forum - 03-02-2010 [eluser]geekindisguise[/eluser] It still says the same thing. The GD function was not supported on this server blah, blah, blah... But it CAN! I have the same script working on this server. Just doesn't make since. GD library works on one form but not the other - El Forum - 03-02-2010 [eluser]LuckyFella73[/eluser] Did you set the right permission (writable) for the upload folder on your second project? Edit: if you just press "upload" without selecting an image (first project) you get this error messages: Code: Failed.0 It seems that you get this "not supporting gd function" message even if the error is not directly related to the library itself Edit 2: sorry for spamming your gallery .. GD library works on one form but not the other - El Forum - 03-03-2010 [eluser]xeroblast[/eluser] i CAREFULLY trace your code and it seems that the problem is in your controller... you already done the upload that is why it produces the GD function not supported bcoz the image doesnt exist anymore... you have to do it this way if you want the original, the big resize, and the thumbnail... first: transfer the $_FILES['image'] to a variable like $original then upload it... second: again, make another copy of $_FILES['image'] to another variable for the resize like $resize then upload it... third and last: make another copy of $_FILES['image'] to another variable for the thumbnail like $thumbnail then upload it and you're done... you can only use the variable once when you do an upload that is why you have to replicate the variable to be use in your upload and resizing... GD library works on one form but not the other - El Forum - 03-04-2010 [eluser]geekindisguise[/eluser] [quote author="xeroblast" date="1267621459"]i CAREFULLY trace your code and it seems that the problem is in your controller... you already done the upload that is why it produces the GD function not supported bcoz the image doesnt exist anymore... you have to do it this way if you want the original, the big resize, and the thumbnail... first: transfer the $_FILES['image'] to a variable like $original then upload it... second: again, make another copy of $_FILES['image'] to another variable for the resize like $resize then upload it... third and last: make another copy of $_FILES['image'] to another variable for the thumbnail like $thumbnail then upload it and you're done... you can only use the variable once when you do an upload that is why you have to replicate the variable to be use in your upload and resizing...[/quote] Are you sure? Because the script for uploading works PERFECTLY elsewhere. But not in this. It is the same script too. And how do I make copies of the $_FILES['image']? Like this:? Code: $original = $_FILES['image']; Yes, I am a newbie at all this. So don't make fun of me if what I said above made NO sense or was completely ridiculous. GD library works on one form but not the other - El Forum - 03-05-2010 [eluser]xeroblast[/eluser] relax... im not making fun of anyone... and YES... do it like that... bcoz i already tried doing that before in making my joomla component... once you use the $_FILES, the variable becomes empty... (try it by using your working uploader, after it has been uploaded, try to var_dump() or print_r() the $_FILES and you dont see any value)... that is why the upload works but after that it wont... |