kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.36k stars 2.39k forks source link

When delete no data are sent to the ajax file #373

Closed RedFoxy closed 9 years ago

RedFoxy commented 9 years ago

Hi all! Sorry for my bad english, I'm begin crazy! I'm trying to add bootstrap-fileinput in my pages, I want upload files and show it when user reload the page, than I want that my user can DELETE files.

To do that I need to send some infos to the ajax.php file, just 2 or 3 variables, than I do it in upload and it GOES really well, but now in delete it doesn't goes, I don't receive ANY data by $_POST or $_GET

Can you help me?

That's my test files:

<input id="uploadLogo" name="images[]" type="file" multiple class="file-loading">

$(document).ready(function() {
  $("#uploadLogo").fileinput(
  {
    allowedFileTypes: ["image"],
    uploadUrl       : "http://localhost/ajax.php", // server upload action
    uploadAsync     : true,
    minFileCount    : 1,
    maxFileCount    : 5,
    overwriteInitial: false,
    language        : 'it',
    initialPreview  : [
        '<img src="/uploads/1/module/1234/logo/20140724004323-33ed52db-me.jpg" class="file-preview-image">',
        '<img src="/uploads/1/module/1234/logo/20150712192301.jpg" class="file-preview-image">',
        '<img src="/uploads/1/module/1234/logo/IMG_0499.JPG" class="file-preview-image">',
        '<img src="/uploads/1/module/1234/logo/sfondo.jpg" class="file-preview-image">',
        '<img src="/uploads/1/module/1234/logo/strada-per-la-stazione.jpg" class="file-preview-image">'
    ],
    initialPreviewConfig: [
          {url:'http://localhost/ajax.php', key: 1, extra: [{ pk : '1234', mod: 'module', sec: 'logo', act: 'd' }]},
          {url:'http://localhost/ajax.php', key: 2, extra: [{ pk : '1234', mod: 'module', sec: 'logo', act: 'd' }]},
          {url:'http://localhost/ajax.php', key: 3, extra: [{ pk : '1234', mod: 'module', sec: 'logo', act: 'd' }]},
          {url:'http://localhost/ajax.php', key: 4, extra: [{ pk : '1234', mod: 'module', sec: 'logo', act: 'd' }]},
          {url:'http://localhost/ajax.php', key: 5, extra: [{ pk : '1234', mod: 'module', sec: 'logo', act: 'd' }]},
             }
    ],
    uploadExtraData: {
          pk : 1234,
          mod: 'module',
          sec: 'logo',
          act: 'i'
    }
  });

I tried with deleteExtraData too but nothing: (when I tried with it I removed the extra: from initialPreviewConfig)

deleteExtraData: {           pk : 1234,           mod: 'module',           sec: 'logo',           act: 'd'     }

I tried to see what the ajax.php file receive, printing $_POST, $_GET and $_FILES, but are all empty

_POST: Array ( )

_GET: Array ( )

_FILES: Array ( )

kartik-v commented 9 years ago

You can try with the updated plugin version from dev-master.

RedFoxy commented 9 years ago

Just tried with last online on github but nothing, it doesn't goes