⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

delet



maha

maha
  • profile picture
  • Member

Posted 18 February 2013 - 09:46 AM

when i add anew photo

the photo uploaded to the path if i saved it or not

 

i want to delete  the photo from upload path if i didn't click on save in add form

 

what function can i use

i tried (before_insert & callback_field) but didn't work.


victor

victor
  • profile picture
  • Member

Posted 18 February 2013 - 10:26 AM

You can make a custom uploader and use it instead default uploader

maha

maha
  • profile picture
  • Member

Posted 18 February 2013 - 11:24 AM

You can make a custom uploader and use it instead default uploader

how ???

do you make it before?


victor

victor
  • profile picture
  • Member

Posted 18 February 2013 - 11:39 AM

NO, I had no need for this.

I have a simple solution ))

 

look:

        $crud = new grocery_CRUD();
        $crud->set_table('portfolio');
        $state = $crud->getState();
        if ($state == 'delete_file')
        {
            echo '{"success":true}';
            exit;
            // it will clean upload input, but doesn't delete file.
        };
      
        /*
         * And other code.... 
         */
        $output = $crud->render();

 


 


maha

maha
  • profile picture
  • Member

Posted 18 February 2013 - 11:44 AM

i don't understand??

if i make your solution the unsaved photo will deleted from upload path on server?


victor

victor
  • profile picture
  • Member

Posted 18 February 2013 - 11:46 AM

sorry I not attentively read a question


maha

maha
  • profile picture
  • Member

Posted 18 February 2013 - 11:53 AM

i tried it but the photo didn't deleted from folder


victor

victor
  • profile picture
  • Member

Posted 18 February 2013 - 11:55 AM

this question is interesting for me too. when I find a solution I type it here. Follow this topic.


maha

maha
  • profile picture
  • Member

Posted 18 February 2013 - 11:57 AM

OK thank you very much.