delete file
- Single Page
Posted 10 December 2012 - 09:56 AM
Then when I try to delete a file after you have uploaded, the file is not deleted. The symbol of the javascript runs constantly spinning. I examined with firebug and get a "page not found".
the file is not deleted from the folder, or database.
What could be the problem?
thank you very much
Posted 11 December 2012 - 22:32 PM
May be this page really doesn't exist
Posted 11 December 2012 - 22:33 PM
Posted 12 December 2012 - 16:19 PM
Where should this page?
This is my controller:
class Pitufo extends Controller {
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->helper('url');
$this->load->library('grocery_CRUD');
}
function noticias_management()
{
$crud = new grocery_CRUD();
$crud->set_table('Noticias');
$crud->columns('not_titulo','not_descrip','not_fecha','not_ocultar','not_file');
$crud->display_as('not_titulo','Titulo de la Noticia');
$crud->display_as('not_descrip','Texto de la Noticia');
$crud->display_as('not_fecha','Fecha de la Noticia');
$crud->display_as('not_ocultar','Ocultar Noticia');
$crud->display_as('not_file','Imagen Asociada');
$crud->set_field_upload('not_file','img/news');
$output = $crud->render();
$this->_example_output($output);
}
Thanks for all
Posted 12 December 2012 - 16:23 PM
Posted 12 December 2012 - 16:35 PM
http://your_site.com/index.php/pitufo/noticias_management/delete_file/not_file/image_name.jpg?_=1355333060290
Have a look at your url (on image).
Posted 12 December 2012 - 16:37 PM
Posted 12 December 2012 - 16:41 PM
what is "Noti...te_file" in your url?
Is it method?
Posted 12 December 2012 - 16:44 PM
Posted 12 December 2012 - 16:46 PM
Posted 12 December 2012 - 16:49 PM
Thanks
Posted 12 December 2012 - 17:00 PM
Posted 27 December 2012 - 11:04 AM
Posted 10 March 2016 - 10:02 AM
same problem image not delete...... -_-
my controller:-
$crud = new Grocery_CRUD();
$crud->columns('story_id', 'name','partner_name','date_of_wedding','tell_story','photo',
'status','slug');
$crud->display_as('story_id','Story Id');
$crud->display_as('name','Name');
$crud->display_as('partner_name','Partner Name');
$crud->display_as('tell_story','Story');
$crud->display_as('photo','Wedding Photo');
$crud->display_as('status','Status');
$crud->set_table('tbl_story');
$crud->callback_column('date_of_wedding',array($this, 'callbackDob'));
$crud->callback_after_insert(array($this,'story_slug'));
$crud->callback_after_update(array($this,'story_slug'));
$crud->callback_after_update(array($this, 'created_dtm_after_update'));
$crud->callback_after_update(array($this,'callback_after_upload'));
$crud->set_field_upload('photo',WEDDING_IMG_PATH);
$crud->callback_after_upload(array($this,'callback_after_upload'));
$crud->add_fields('name','partner_name','date_of_wedding','tell_story','photo','status');
$crud->edit_fields('name','partner_name','date_of_wedding','tell_story','photo','status');
$crud->required_fields('name','partner_name','date_of_wedding','tell_story','photo','status');
$crud->order_by('created_dtm','dsc');
$crud->field_type('date_of_wedding', 'date');
$crud->set_subject('New Story');
if($this->role == ROLE_SUBADMIN && $this->updations == ALLOW)
{
$crud->unset_upload();
$crud->unset_delete();
$crud->unset_add();
$crud->unset_read();
}
else if($this->role == ROLE_ADMIN)
{
$crud->unset_read();
}
else
{
$crud->unset_delete();
$crud->unset_add();
$crud->unset_read();
$crud->unset_edit();
}
$output = $crud->render();
$this->storyOutput($output);
}
function created_dtm_after_update($post_array,$primary_key)
{
$date_update = array(
"story_id" => $primary_key,
"created_dtm" => date('Y-m-d H:i:s')
);
$this->db->update('tbl_story',$date_update,array('story_id' => $primary_key));
return true;
}
function callback_after_upload($uploader_response,$field_info, $files_to_upload)
{
$this->load->library('image_moo');
//Is only one file uploaded so it ok to use it with $uploader_response[0].
$file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->photo;
$this->image_moo->load($file_uploaded)->resize(800,600)->save($file_uploaded,true);
return true;
}
Posted 19 November 2018 - 02:48 AM
Ensure to set properly this variable on your config.php file
$config['index_page'] = 'index.php';
In my case I changed and now "delete" link is working fine.