Dropzone normal form issue
Hey guys I'm trying to use dropezone in a normal form but it seems when I'm submitting it's only charging the pictures
this is my html code:
<form role="form" action="{{route('handleAddNewTrip')}}" class="dropzone" id="mydropzone" method="post" enctype="multipart/form-data">
{{csrf_field()}}
<div class="col-md-6">
<div class="form-group">
<label>Titre de voyage</label>
<div id="dropzonePreview"></div>
<button type="submit" name="save" class="btn btn-primary pull-right">Ajouter</button>
<button type="reset" class="btn btn-default pull-right">Annuler</button>
</div>
</div>
</form>
this is my js code
<script>
// Bind the event handler to the "submit" JavaScript event
$('form').submit(function(e) {
myDropzone.processQueue();
Dropzone.options.mydropzone = {
//url does not has to be written
//if we have wrote action in the form
//tag but i have mentioned here just for convenience sake
url: '{{route('handleAddNewTrip ')}}',
addRemoveLinks: true,
autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
autoDiscover: false,
paramName: 'pic', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then bydefault it taked 'file' as paramName eg: $_FILE['file']
previewsContainer: '#dropzonePreview', // we specify on which div id we must show the files
clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable
accept: function(file, done) {
console.log("uploaded");
done();
},
error: function(file, msg) {
alert(msg);
},
};
</script>
php laravel dropzone
add a comment |
Hey guys I'm trying to use dropezone in a normal form but it seems when I'm submitting it's only charging the pictures
this is my html code:
<form role="form" action="{{route('handleAddNewTrip')}}" class="dropzone" id="mydropzone" method="post" enctype="multipart/form-data">
{{csrf_field()}}
<div class="col-md-6">
<div class="form-group">
<label>Titre de voyage</label>
<div id="dropzonePreview"></div>
<button type="submit" name="save" class="btn btn-primary pull-right">Ajouter</button>
<button type="reset" class="btn btn-default pull-right">Annuler</button>
</div>
</div>
</form>
this is my js code
<script>
// Bind the event handler to the "submit" JavaScript event
$('form').submit(function(e) {
myDropzone.processQueue();
Dropzone.options.mydropzone = {
//url does not has to be written
//if we have wrote action in the form
//tag but i have mentioned here just for convenience sake
url: '{{route('handleAddNewTrip ')}}',
addRemoveLinks: true,
autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
autoDiscover: false,
paramName: 'pic', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then bydefault it taked 'file' as paramName eg: $_FILE['file']
previewsContainer: '#dropzonePreview', // we specify on which div id we must show the files
clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable
accept: function(file, done) {
console.log("uploaded");
done();
},
error: function(file, msg) {
alert(msg);
},
};
</script>
php laravel dropzone
add a comment |
Hey guys I'm trying to use dropezone in a normal form but it seems when I'm submitting it's only charging the pictures
this is my html code:
<form role="form" action="{{route('handleAddNewTrip')}}" class="dropzone" id="mydropzone" method="post" enctype="multipart/form-data">
{{csrf_field()}}
<div class="col-md-6">
<div class="form-group">
<label>Titre de voyage</label>
<div id="dropzonePreview"></div>
<button type="submit" name="save" class="btn btn-primary pull-right">Ajouter</button>
<button type="reset" class="btn btn-default pull-right">Annuler</button>
</div>
</div>
</form>
this is my js code
<script>
// Bind the event handler to the "submit" JavaScript event
$('form').submit(function(e) {
myDropzone.processQueue();
Dropzone.options.mydropzone = {
//url does not has to be written
//if we have wrote action in the form
//tag but i have mentioned here just for convenience sake
url: '{{route('handleAddNewTrip ')}}',
addRemoveLinks: true,
autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
autoDiscover: false,
paramName: 'pic', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then bydefault it taked 'file' as paramName eg: $_FILE['file']
previewsContainer: '#dropzonePreview', // we specify on which div id we must show the files
clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable
accept: function(file, done) {
console.log("uploaded");
done();
},
error: function(file, msg) {
alert(msg);
},
};
</script>
php laravel dropzone
Hey guys I'm trying to use dropezone in a normal form but it seems when I'm submitting it's only charging the pictures
this is my html code:
<form role="form" action="{{route('handleAddNewTrip')}}" class="dropzone" id="mydropzone" method="post" enctype="multipart/form-data">
{{csrf_field()}}
<div class="col-md-6">
<div class="form-group">
<label>Titre de voyage</label>
<div id="dropzonePreview"></div>
<button type="submit" name="save" class="btn btn-primary pull-right">Ajouter</button>
<button type="reset" class="btn btn-default pull-right">Annuler</button>
</div>
</div>
</form>
this is my js code
<script>
// Bind the event handler to the "submit" JavaScript event
$('form').submit(function(e) {
myDropzone.processQueue();
Dropzone.options.mydropzone = {
//url does not has to be written
//if we have wrote action in the form
//tag but i have mentioned here just for convenience sake
url: '{{route('handleAddNewTrip ')}}',
addRemoveLinks: true,
autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
autoDiscover: false,
paramName: 'pic', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then bydefault it taked 'file' as paramName eg: $_FILE['file']
previewsContainer: '#dropzonePreview', // we specify on which div id we must show the files
clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable
accept: function(file, done) {
console.log("uploaded");
done();
},
error: function(file, msg) {
alert(msg);
},
};
</script>
php laravel dropzone
php laravel dropzone
edited Jan 3 at 10:48
MONSTEEEER
474214
474214
asked Jan 3 at 10:17
Atef RihaneAtef Rihane
417
417
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It could be this:
Try adding 'acceptedFiles' to your dropzone options, it expects an array of accepted extensions.
It worked for me.
Docs: https://www.dropzonejs.com/#config-acceptedFiles
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020268%2fdropzone-normal-form-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It could be this:
Try adding 'acceptedFiles' to your dropzone options, it expects an array of accepted extensions.
It worked for me.
Docs: https://www.dropzonejs.com/#config-acceptedFiles
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
add a comment |
It could be this:
Try adding 'acceptedFiles' to your dropzone options, it expects an array of accepted extensions.
It worked for me.
Docs: https://www.dropzonejs.com/#config-acceptedFiles
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
add a comment |
It could be this:
Try adding 'acceptedFiles' to your dropzone options, it expects an array of accepted extensions.
It worked for me.
Docs: https://www.dropzonejs.com/#config-acceptedFiles
It could be this:
Try adding 'acceptedFiles' to your dropzone options, it expects an array of accepted extensions.
It worked for me.
Docs: https://www.dropzonejs.com/#config-acceptedFiles
answered Jan 3 at 12:13
nyu.exenyu.exe
1278
1278
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
add a comment |
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
can u send me please a jsfiddle link of a working example ?
– Atef Rihane
Jan 3 at 13:09
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
I've it working on a development stage project. The above tip didn't worked for you?
– nyu.exe
Jan 3 at 13:10
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
whenever I try to dump in the controller.. I don't see the files that got uploaded ://
– Atef Rihane
Jan 3 at 13:18
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020268%2fdropzone-normal-form-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown