Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:09:32+00:00 2026-05-31T15:09:32+00:00

I am using jquery plugin for multiple file upload. Everything is working fine, except

  • 0

I am using jquery plugin for multiple file upload. Everything is working fine, except delete the images. Firebug say that JS it is sending DELETE request to the function. How can I get data from delete request?

PHP delete code:

public function deleteImage() {
    //Get the name in the url
        $file = $this->uri->segment(3);
    $r = $this->session->userdata('id_user');
    $q=$this->caffe_model->caffe_get_one_user($r);
        $cff_name= $q->name;
    $cff_id = $q->id_caffe;       

    $w = $this->gallery_model->gallery_get_one_user($gll_id);
    $gll_name = $w->name;
        $success = unlink("./public/img/caffe/$cff_name/$gll_name/" . $file);
        $success_th = unlink("./public/img/caffe/$cff_name/$gll_name/thumbnails/" . $file);

        //info to see if it is doing what it is supposed to 
        $info = new stdClass();
        $info->sucess = $success;
        $info->path = $this->getPath_url_img_upload_folder() . $file;
        $info->file = is_file($this->getPath_img_upload_folder() . $file);
        if (IS_AJAX) {//I don't think it matters if this is set but good for error checking in the console/firebug
            echo json_encode(array($info));
        } else {     //here you will need to decide what you want to show for a successful delete
            var_dump($file);
        }
    }

and JS is using jQuery-File-Upload plugin: link

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:09:33+00:00Added an answer on May 31, 2026 at 3:09 pm

    Generally, if the DELETE request sends data in the request body, you can read the data by using the following code:

    $data = file_get_contents("php://input");
    

    Depending on the encoding of the data (usually JSON or form-encoded), you use json_decode or parse_str to read the data into usable variables.

    For a simple example, see this article, where the author uses form-encoded data to handle a PUT request. DELETE works similarly.


    In your case however, it looks like the file name is read from the request URL (the call to $this->uri->segment(3);). When I look at your code, it seems that the variable $gll_id is not initailized and you don’t check if the resulting object $w and the variable $gll_name are empty. Maybe this is causing the delete to fail. Turn on error logging with ini_set("log_errors",1); and have a look at your server error log. If the unlink fails, the error log should contain the path PHP tried to unlink – it’s likely that the path is not correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the uploadify jquery plugin to upload multiple files. Everything works fine, but
I'm using the jQuery multi-file upload plugin found here: http://www.fyneworks.com/jquery/multiple-file-upload/ I don't see in
I am using the multi-upload plugin found at: http://www.fyneworks.com/jquery/multiple-file-upload/ This is what I am
I am working with a search form that using the jqTransform jquery plugin. Its
I am uploading file using jQuery uploadify plugin. Each time I upload a file,
I am using 'Uploadify' Jquery plugin in my MVC 3.0 application to upload multiple
I am using uploadify plugin of jquery and have set multiple files upload to
I am using Jquery Cycle Plugin and it has a side panel that highlights
i m using jQuery tablsorter plugin, it's working perfect,but now problem is ... i
I'm using the jQuery cycle plugin to create multiple slideshows on a single page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.