Skip to content

No clear definition of the behavior mimetype Sf 2.0.* #5039

@isqad

Description

@isqad

Uploading Excel file with the extension xls. When I var_dump my File I have no clear definition of the behavior mimetype. Why mimeType in Symfony\Component\HttpFoundation\File\UploadedFile is different of getMimeType()?

class Symfony\Component\HttpFoundation\File\UploadedFile#13 (5) {
  private $test =>
  bool(false)
  private $originalName =>
  string(26) "Отчет 12.07-18.07.xls"
  private $mimeType =>
  string(24) "application/vnd.ms-excel"
  private $size =>
  int(56832)
  private $error =>
  int(0)
}
NULL
string(25) "application/vnd.ms-office"
$files = $request->files->get('portal_controlbundle_import_tasktype');
var_dump($files['tasksFile']);
var_dump($files['tasksFile']->guessExtension());
var_dump($files['tasksFile']->getMimeType());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions