Upload::process(array( 'prefix'=> Session::get('user_id').'_', 'randomize'=> true, ));// get the file and if the file is valid save it
Upload::get_files(); if (Upload::is_valid()) { Upload::save();}// The upload function works with arrays ( multiple uploads possible) which is why i use foreach to process any image uploaded
$files = Upload::get_files(); foreach( $files as $key=>$file ) {// getting the full path of the file
$filepath=$file['saved_to'].$file['saved_as'];// if you wanna resize the image for example
$width=640; $height=480; Image::factory()->load($filepath) ->resize($width, $height) ->save($filepath); }
Salmane S wrote on Thursday 26th of May 2011:I am a bit confused as to how to exactly How to upload , modify and save an image. if I am correct, I must use the upload class to upload the file then use the Image class to load , modify the image then save it Please correct me if i am wrong in this logic it would be also great if i can get a rough idea as to how to proceed with this logic I have also tried loading an image from the server in order to modify it and save it but had little success when i do this : $image=Image::factory(array('quality' => 80)); $image->load("photos/user/1910_1291778441_432224420.png",true); i get the following error : Fuel\Core\Fuel_Exception [ Error ]: The library does not support this filetype for .....
thank you for your help
It looks like you're new here. If you want to get involved, click one of these buttons!