search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Upload file on creating new event

Asked by Koen
2 months ago.

I would like to upload a file when creating new events. Somehow it does not seem possible to pass the file-data over the submit function from daypilot. See html code and screenshot from the current result. Is daypilot limiting the content sent by the submit function?

Answer posted by Dan Letecky [DayPilot]
2 months ago.

You can see that the form submission is intercepted and sent using a special $.post() request:

$("#f").submit(function () {
    var f = $("#f");
    $.post(f.attr("action"), f.serialize(), function (result) {
    return false;

You'll have to use FormData and $.ajax() in order to submit the data including the file.

See also:

You might need to play with this snippet a little bit - as far as I can see the accepted answer uses this:

var fd = new FormData($("#fileinfo"));

which needs to be replaced with

var fd = new FormData($("#fileinfo")[0]);
New Reply
This reply is
Your name (optional):