It's been now 2 days since I'm trying to upload videos in my Laravel 4 App, the problem I'm facing is that I have an input file to upload the file, the odd matter to notice is That when I upload an image an then I do this dd(Input::file('file')) this actually works and I get the Symfony\Component\HttpFoundation\File\UploadedFile but then again, when I upload a video, it returns null, plz anyone help, I'm really starting to get crazy here, even by dumping the $_FILES, nothing comes out here's the code I'm making for the form :
{{ Form::open(array('url' => '/upload', 'enctype' => 'multipart/form-data','files' => true)) }}
{{ Form::file('video',null) }}
{{ Form::submit('Upload') }}
{{ Form::close() }}
simple stuff nothing too big, here's the route:
Route::post('upload', 'VideosController@upload');
and here's the method to do the magic !!
var_dump($_FILES);
var_dump(Input::file('video'));
dd(Input::all());
$filename = $file->getClientOriginalName();
$path = public_path().'/uploads/';
return $file->move($path, $filename);
I hope yu guys can help me with this odd issue !!
I have same issue, when I upload images it uploads and when i choose videos it returns null
You php.ini files contains some limits that might affect this. Try changing these to high enough values:
upload_max_filesize = 10M
post_max_size = 10M
memory_limit = 32M
Hi everyone! I have the same problem! When i upload images it's working perfectly but when i try to upload videos or audio files i get this error : " Call to a member function getClientOriginalName() on a non-object ". So i tried to change the values in the php.ini but it didn't work! The only thing i found by researching on the internet is a bunch of people who have the same problem and no solution to it. Does anyone know how to fix this? Thanks
Just wanted to add on ... I was experiencing this issue on my server but not on my local env. Then I realized that my php.ini settings were different on my server ... Changing the values suggested by ErikEklund above ended up fixing it.
ErikEklund said:
You php.ini files contains some limits that might affect this. Try changing these to high enough values:
upload_max_filesize = 10M post_max_size = 10M memory_limit = 32M
It doesn't make sense on the surface, but if you submit a file that is too large for the servers config settings, you lose all input data.
Hope this helps someone. :D
hi check long time script TT if use linux i test phpinfo run php.ini by /etc/php5/apache2/php.ini laravel run php.ini by /etc/php5/cli/php.ini
edit upoload max , post max , memory limit
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community