vlodkow's avatar

Error with file uploading in Laravel 5.2.15

Just update to Laravel v5.2.15 and when I try to upload file, receive this error:

FatalErrorException in RedirectResponse.php line 11: Cannot use Symfony\Component\HttpFoundation\File\UploadedFile as UploadedFile because the name is already in use

When return back to Laravel v5.2.14 all work fine.

0 likes
7 replies
zss's avatar

I had the same problem. Return back helped. Thanks for hint.

angelside's avatar

I have too

'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Cannot use Symfony\Component\HttpFoundation\File\UploadedFile as UploadedFile because the name is already in use' in vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php:11
mars's avatar

Just experienced the same. 5.2.14 does the trick.

timgavin's avatar

@usman I'm having the same issue with 5.2.15. Had to go back to .14 and it worked again.

1 like
vladzur's avatar

Apparently the fix is not yet available, if we look at the tag 5.2.15, this change does not exist. I think by now expect this correction becomes available in a new tag (5.2.16?).

usman's avatar

@vladzur there is no need to revert back to the the 5.2.14, just manually make the change in your src/Illuminate/Http/RedirectResponse.php file, i.e. on line 11 replace the use Symfony\Component\HttpFoundation\File\UploadedFile with use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile and on line 80 replace the UploadedFile with SymfonyUploadedFile and you are good to go. The change will persist on the next tag update so there is no harm in editing the core file.

ping: @vlodkow

1 like

Please or to participate in this conversation.