Closed ramil8090 closed 9 years ago
Why you cannot save single uploaded image? What is wrong? On my site it works fine!
It don't save single file when he uploaded asynchronously because in returned JSON there is no filename, but only empty array
Single file? What configuration options did you use? I have uploaded a single file just now and it works good
I will checkout configuration in monday.
Sorry, but i already delete code that emulate error. Anyway i will try again when i will be in office but later. Now i think we must close this issue
In FileController.php -> actionUpload we can't save single uploaded image. Where ELSE block you must store file name in $result array. Code must like this
if (is_array($model->file)) { foreach ($model->file as $file) { $path = $this->getModule()->getUserDirPath() . DIRECTORY_SEPARATOR . $file->name; $file->saveAs($path); $result['uploadedFiles'][] = $file->name; } } else { $path = $this->getModule()->getUserDirPath() . DIRECTORY_SEPARATOR . $model->file->name; $model->file->saveAs($path);
!!!!add this string!!!! --> $result['uploadedFiles'][] = $model->file->name; }