0

For this plugin, I'v been able to upload and manage my files perfectly. The problem begins with deleting a file after it's been uploaded and appears in the upload queue.

Originally the index.php file where the uploader is located looks like this:

error_reporting(E_ALL | E_STRICT);
require('UploadHandler.php');

$upload_handler = new UploadHandler();

However, the way I've customized this in order to upload files in a specified directory, the index file now looks like this:

error_reporting(E_ALL | E_STRICT);
require_once('../../plugins/jqupload/server/php/UploadHandler.php');


$job = $_POST['path'];


$customer_path_files =  $_SERVER['DOCUMENT_ROOT']. '/'.$job.'/';
$customer_path_url = '../../'. JOB_FILES_PATH.$job.'/';
    if (!file_exists($customer_path_files)) {

    @mkdir($customer_path_files ,0777,true);


}

$options=array(
'upload_dir' => $customer_path_files,
'upload_url' => $customer_path_url ,
'max_number_of_files' => 10
);

$upload_handler = new UploadHandler($options);

This also works perfectly. The only problem begins when clicking on the delete button that doesn't fire. Any ideas? Do I need to pass another value somewhere?

2
  • Did you find a solution to this problem? I'm still searching a way... Commented Jan 16, 2015 at 18:21
  • [enter link description here][1] See this article [1]: stackoverflow.com/questions/18472277/… Commented Jun 13, 2015 at 13:28

1 Answer 1

0

What I did to delete the uploaded file is to create a deleteBtn in the done: and add the click function to it and in there just do an ajax call using that file name, I had to also re-create the full file name that get's extra stuff put on it before writing it to disk somewhere, then it will delete it from the specified location from your props file.

Then just deleteBtn.appendTo($('#someOtherDiv')) that shows the uploaded file and then it has the delete button right next to it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.