![]() |
Need help for resize uploaded picture. - 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: Need help for resize uploaded picture. (/showthread.php?tid=50414) |
Need help for resize uploaded picture. - El Forum - 03-26-2012 [eluser]lamhuy300890[/eluser] I have write code to multiple field uploading and resize thumbnail picture. The code can upload picture from all field but it only resize the first picture. Anyone can help me ? Sorry for my bad English. Thanks. Code: //set config for upload image Need help for resize uploaded picture. - El Forum - 03-26-2012 [eluser]LuckyFella73[/eluser] Hi Lamhuy, try it this way - should work: Code: <?php The important part is where you fire the clear function. I like tp put such code into an extra function - you could copy that lines into your upload method directly of course. Need help for resize uploaded picture. - El Forum - 03-26-2012 [eluser]lamhuy300890[/eluser] Hi LuckyFella73, It work great. Thank you so much. Need help for resize uploaded picture. - El Forum - 03-26-2012 [eluser]LuckyFella73[/eluser] You are welcome! Need help for resize uploaded picture. - El Forum - 03-27-2012 [eluser]the_unforgiven[/eluser] im need to know solution to my code too if anyone is willing help. this is my code: which works inserts into the database and uploads to the specific folder in upload path config, but what i want to do is resize it before it does any of that. how and example would be appreciated based on my code. Code: function _do_upload_file() Need help for resize uploaded picture. - El Forum - 03-27-2012 [eluser]LuckyFella73[/eluser] Quote:but what i want to do is resize it before it does any of thatOn PHP base you can't resize the image before uploading (if its that what you meant) What you can do is something like that: Code: // return "$filedata" like you have it now instead of "TRUE" In case you have your "_do_upload_file" function as a callback as a form-validation rule just set up a new callback function and fire the upload and resize function inside the callback. Need help for resize uploaded picture. - El Forum - 03-28-2012 [eluser]the_unforgiven[/eluser] Hi, Im not sure i understand what you mean,yes sorry i realised you can't resize until after upload, so i need to upload the image then resize it and place in a thumbs folder how can this be done? Sorry to be a pain just trying to get a better understanding.... |