Vue-dropzone: Header Parm names

Created on 26 Nov 2016  路  5Comments  路  Source: rowanwins/vue-dropzone

I have added some parameters. But in Laravel there is no value being passed here is my vue code of the component.

 <dropzone id="fileDropZone"  url="api/track/upload" options="{headers:{'Token':{{tokenVal}},'trackCategory':{{track.trackCategory}}}}"></dropzone>

Upload controller code

   /*Upload File */
    public function uploadFile(Request $request){

        $file = $request->file('file');
        $file->store('tracks/multiv');
        $trackCat= $request->trackCategory;

        $token= $request->Token;
        $fileName=$file->getFilename();

        /*Return response */
        return response()->json([
            'filename' => $fileName,
            'trackCategory' => $trackCat,
            'token' => $token,
        ]);

    }

Most helpful comment

Hi @kyoukhana

So you'll need to do a couple of things

  1. First set v-bind:use-custom-dropzone-options="true"
  2. Secondly pass in your v-bind:dropzone-options="options"

````

````

Hope that helps

All 5 comments

Problem is the Headers are not even being passed in the Post.

Any ideas on this issue? Really Struggling with this one.

Hi @kyoukhana

So you'll need to do a couple of things

  1. First set v-bind:use-custom-dropzone-options="true"
  2. Secondly pass in your v-bind:dropzone-options="options"

````

````

Hope that helps

Shouldn't options be like this

 v-bind:dropzone-options="{{options}}"

@kyoukhana when passing down props using v:bind there is no need to use the {{ }} syntax, take a look at the vue doco for more info.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pdt590 picture pdt590  路  3Comments

morance picture morance  路  3Comments

dainemedia picture dainemedia  路  4Comments

syrex88 picture syrex88  路  6Comments

azhard4int picture azhard4int  路  6Comments