0

I have been working with Laravel and Dropzone JS so I can have a drag and drop file upload feature but it isn't seeming to want to upload.

This is my blade.php file, starting the form and it displays how I want it, but I think my issues are in the action tag.

<form class="dropzone" id="images-dropzone" method="post" action="{{ url('/upload') }}"></form>

Then in my routes file I have a very simple setup to catch it, but it does not seem to ever get here.

Route::post('/upload', function(){
    $file = Input::file('file');
    $directory = 'uploads/test/';
    $upload_success = Input::file('file')->move($directory, $file);
});

2 Answers 2

3

Missing enctype="multipart/form-data" in the form I think.

<form enctype="multipart/form-data" class="dropzone" id="images-dropzone" method="post" action="{{ url('/upload') }}"></form>
Sign up to request clarification or add additional context in comments.

Comments

0

In addition to setting the enctype, check that upload_max_filesize in the PHP config allows the size of the file you are uploading. If you upload a larger file, it won't even show up if you log $request->all()

Suggestion from this thread: https://github.com/laravel/framework/issues/485#issuecomment-44801310

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.