Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different sending mimes in params for different command #2210

Closed
kunashir opened this issue Sep 19, 2017 · 1 comment
Closed

Different sending mimes in params for different command #2210

kunashir opened this issue Sep 19, 2017 · 1 comment
Assignees

Comments

@kunashir
Copy link

I have next declaration for using elFinder:

var elf = $('#elfinder').elfinder({
        url: "/web_api/file_manager/actions",
        transport : new elFinderSupportVer1(),
        getFileCallback : function(file) {
          window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
          elf.destroy();
          window.close();
        },
        customHeaders: buildAuthHeaders(),
        lang: 'ru',
        resizable: false,
        onlyMimes: ["image/jpeg", "image/gif","image/png"],
        mimeDetect: 'mime_content_type'
      }).elfinder('instance');
     });

But I've noted what mimes sending in different format for different command:

Started POST "/web_api/file_manager/actions" for 127.0.0.1 at 2017-09-19 13:40:47 +0300
  ActiveRecord::SchemaMigration Load (1.0ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by WebApi::FileManagerController#actions as HTML
  Parameters: {"cmd"=>"upload", "current"=>"Lg", "mimes"=>{"0"=>"image/jpeg", "1"=>"image/gif", "2"=>"image/png"}, "upload"=>[#<ActionDispatch::Http::UploadedFile:0x00000004c66cc8 @tempfile=#<Tempfile:/tmp/RackMultipart20170919-9360-ugd18a.png>, @original_filename="image_2017-01-27_15-21-20.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"upload[]\"; filename=\"image_2017-01-27_15-21-20.png\"\r\nContent-Type: image/png\r\n">], "mtime"=>["1485519700"]}

In this case I have an object for mimes, but in:

Started GET "/web_api/file_manager/actions?mimes%5B%5D=image%2Fjpeg&mimes%5B%5D=image%2Fgif&mimes%5B%5D=image%2Fpng&cmd=open&reload=1&target=Lg&tree=1&compare=&_=1505817647665" for 127.0.0.1 at 2017-09-19 13:40:47 +0300
Processing by WebApi::FileManagerController#actions as HTML
  Parameters: {"mimes"=>["image/jpeg", "image/gif", "image/png"], "cmd"=>"open", "reload"=>"1", "target"=>"Lg", "tree"=>"1", "compare"=>"", "_"=>"1505817647665"}

I have got an array!
Is it correct behavior or I'm doing something wrong?

@nao-pon
Copy link
Member

nao-pon commented Sep 19, 2017

@kunashir This a bug of upload command. so I'll fix it.

Thanks! 👍

@nao-pon nao-pon self-assigned this Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants