dropzone.js - Uploading larger file size using Dropzonejs -
i trying use dropzonejs upload music , video files, when tried image files worked fine, upload successful, on trying video , music files gives error: “warning post content of ------- bytes exceeds limit of --------.” have set configuration dropzone seems not solve problem. because i’m working laravel, edited php_ini file of xampp, increase max_file_size , other parameters, did not solve problem either, since i’m running laravel-5.3, it’s evident might have own internal server because wether i’m running xampp or not once start laravel server runs or without starting apache on xampp. do? appreciate.
<div class="row"> <div class="col-md-12"> <form action="{{ url('/songs/do-upload') }}" class="dropzone" id="addsongs">{{csrf_field()}} <input type="hidden" name="albums_id" value=" {{$albums->id}} "> </form> </div> </div> <script type="text/javascript"> dropzone.options.addsongs = { paramname: 'file', clickable: true, enqueueforupload: true, autoprocessqueue: true, uploadmultiple: true, paralleluploads: 5, maxfiles: 1, maxfilesize: 250, addremovelinks: true, dictdefaultmessage: 'drag images here', init: function() { console.log('init'); this.on("maxfilesexceeded", function(file){ alert("no more files please!"); this.removefile(file); }); } }; </script>
controller used in uploading:
public function doimageupload(request $request){ $file = $request->file('file'); $filename = uniqid() .$file->getclientoriginalname(); $file->move('album/songs', $filename); $albums = albums::findorfail($request->input('albums_id')); $album = $albums->songs()->create([ 'user_id' => auth::user()->id, 'albums_id' => $request->input('albums_id'), 'file_name' => $filename, 'file_size' => $file->getclientsize(), 'file_mime' => $file->getclientmimetype(), 'file_path' => 'album/songs' .$filename ]); }
error message on console:
1:107 uncaught referenceerror: dropzone not defined http://localhost:8000/songs/do-upload failed load resource: server responded status of 500 (internal server error) jquery-1.9.0.js:1'//@ sourceurl' , '//@ sourcemappingurl' deprecated, please use '//# sourceurl=' , '//# sourcemappingurl=' instead.
thanks, everyone. simple mistake didn't restart laravel server. appreciate.
Comments
Post a Comment