Do not repeat definition of $target.
Do not repeat JSON success code.
Adjust JSON code to stable5.
Use multiple lines for the JSON data array.
Merge pull request #4363 from owncloud/fix-4355

Send mime-type for new files