Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • B blaupload
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Luke Bratch
  • blaupload
  • Merge requests
  • !6

Multiple upload

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Phil Burton requested to merge multiple-upload into master Apr 09, 2019
  • Overview 0
  • Commits 7
  • Changes 4

Staged: http://wales.pgburton.com/

Switch to using multiple attr on the file upload input. This then adds arrays of info to the $_FILE array. As this is kind of janky; the array is an array of attributes which each then contain the attributes for multiple files.

e.g.

$out = [
  'name' => [
      'a',
      'b'
  ],
  'error' => [
    0,
    0
  ]
];

We don't like this as we can't loop easily over the different files.

Instead we simply pivot the table so it looks more like:

$out = [
  0 => [
    'name' => 'a',
    'error' => 0
  ].
  1 => [
    'name' => 'b',
    'error' => 0
  ].
];

Next we create an $out array which handles the success/error messages, as now we may want to have messages per uploaded file.

Edited Apr 09, 2019 by Phil Burton
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: multiple-upload