⚠ 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

Deleting a require upload file



die_for_rock_vn
  • profile picture
  • Member

Posted 15 October 2014 - 06:57 AM

I have an issue when delete the upload file on edit. If upload field is require, after delete this file I can’t save the record. But if I close browser and open again, this record has empty upload field without any error. Is there any solution? Thanks. 

My code:

$crud->required_fields ( 'name', 'image', 'price' );
$crud->set_field_upload ( 'image', $this->config->item ( 'image_path' ) );

'image' file field is a require.


Amit Shah
  • profile picture
  • Member

Posted 15 October 2014 - 07:26 AM

Technically no - there aint a solution to what you cannot control..

u cannot control the user from shutting down the app by closing the browser ...

When u delete a file (in case of edit) the file is deleted and the value in the record is emptied. It is expected that u upload a new 1 and save the same.

 

There is no solution as for now to deal with. You might have to come up with your own in this case.

 

PLUS... u never defined as what you really are looking for as a solution .. u just expressed a situation..


die_for_rock_vn
  • profile picture
  • Member

Posted 15 October 2014 - 07:50 AM

Technically no - there aint a solution to what you cannot control..

u cannot control the user from shutting down the app by closing the browser ...

When u delete a file (in case of edit) the file is deleted and the value in the record is emptied. It is expected that u upload a new 1 and save the same.

 

There is no solution as for now to deal with. You might have to come up with your own in this case.

 

PLUS... u never defined as what you really are looking for as a solution .. u just expressed a situation..

Thank you. I just think about "Replace file" button, user can't delete the file but can replace it. Or user can delete but the file and database record is not be removed untill he upload a new file.


Amit Shah
  • profile picture
  • Member

Posted 15 October 2014 - 16:07 PM

thats much better solution .. good you are growing up better

 

Happy GCing :)