Why are my uploaded photos automatically renamed

Posted 2 years ago by fsdolphin

Hi,

Why are my uploaded photos automatically renamed?

I uploaded two pictures and they end up with the following names... phpCojNCI and phpyIqyDd. Is this normal

Here is the code.

Form:

<form method="POST" action="/photos" enctype="multipart/form-data">
          {!! csrf_field() !!}
            <div class="form-group">
                <input type="file" name="name" class="form-control" >
            </div>
            <div class="form-group">
                <input type="submit" class="form-control">
            </div>
</form>

Controller:

public function store()
{
    $file = Request::file('name');
    $file->move(public_path() . '/images/');
}

Where does the renaming happens?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.