Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would place the jquery plugin contents into <code>web/bundles/&lt;your bundle name&gt;/js/jquery-file-upload</code>. And then I would configure the script (check <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Options">Options</a> config) to look for the index.php file at: <code>/bundles/&lt;your bundle name&gt;/js/jquery-file-upload/server/php/index.php</code>.</p> <p>Of course, you'll have to modify that index.php file to check if the user is logged in and if he has the right permissions.</p> <p>As an example, this is what I did in a test environment:</p> <p>I added this action to the controller:</p> <pre><code>/** * @Route("/test/jquery-file-upload") * @Template("&lt;your bundle name&gt;:Default:test-jquery-file-upload.html.twig") */ public function testJqueryFileUploadAction() { return array(); } </code></pre> <p>And I created this template:</p> <pre><code>&lt;input id="fileupload" type="file" name="files[]" data-url="{{ asset('bundles/&lt;your bundle name&gt;/jquery-file-upload/server/php/index.php') }}" multiple&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="{{ asset('bundles/&lt;your bundle name&gt;/jquery-file-upload/js/vendor/jquery.ui.widget.js') }}"&gt;&lt;/script&gt; &lt;script src="{{ asset('bundles/&lt;your bundle name&gt;/jquery-file-upload/js/jquery.iframe-transport.js') }}"&gt;&lt;/script&gt; &lt;script src="{{ asset('bundles/&lt;your bundle name&gt;/jquery-file-upload/js/jquery.fileupload.js') }}"&gt;&lt;/script&gt; &lt;script&gt; $(function () { $('#fileupload').fileupload({ dataType: 'json', done: function (e, data) { $.each(data.result, function (index, file) { $('&lt;p/&gt;').text(file.name).appendTo(document.body); }); } }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload