I'm developing my custom component and I need to call some task from back-end controller during editing a single record. The url of my record edit page in the back-end is:


There is my ajax-query for calling a task in the record controller:

 method: "POST",
 cache: false,
 url: 'index.php?option=com_mycom&task=deleteimg&format=raw&id=<?php echo $this->item->id; ?>',
 data: {id: '<?php echo $this->item->id; ?>'}
}).done(function() {
return false;

I tried also the urls:


But every time console displays me the 404 error:

POST ...//domain.com/administrator/index.php?...&id=2 404 (... [name, type, prefix]: pages, raw, mycomView)

What the correct url should be?


Try this one:

index.php?option=com_mycom&task=yourcontroller.deleteimg&tmpl=component&id=<?php echo $this->item->id; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.