Support the ongoing development of Laravel.io →
Requests Input

I am working on the following laracast: https://laracasts.com/series/build-project-flyer-with-me/episodes/11

I am at the part where your using the request object to get the uploaded files. However, every file that I upload is coming through as an octet stream and has a file size of 0. Any ideas why this might be?

flyers/show.blade.php:

@extends('layout')

@section('content')
    <h1>{{ $flyer->street }}</h1>
    <h2>{!! $flyer->price !!}</h2>
    <hr/>
    <div class="description">{!! nl2br($flyer->description) !!}</div>
    <form action="/{{ $flyer->zip }}/{{ $flyer->street }}/photos" method="POST" class="dropzone" enctype="multipart/form-data">
        {{ csrf_field() }}
    </form>
@stop

@section('scripts.footer')
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.2.0/dropzone.js"></script>
@stop

Controllers/FlyersController.php:

public function addPhoto(Request $request)
{
    $file = $request->file('file');

    return $file->getClientSize();
}
Last updated 2 years ago.
0

So I ended up using $request->file('file')->getErrorMessage() and found out:

The file "100_0394.JPG" exceeds your upload_max_filesize ini directive (limit is 2048 KiB).
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.