Skip to content

Instantly share code, notes, and snippets.

View paulgv's full-sized avatar

Paul Gascou-Vaillancourt paulgv

View GitHub Profile
@paulgv
paulgv / vimeoPutUpload.html.twig
Last active November 12, 2020 17:58
This is a basic example of how to perform a PUT upload using jQuery.fileupload and Vimeo's API https://developer.vimeo.com/api/upload#http-put-uploading
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/vendor/jquery.ui.widget.js') }}"></script>
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/jquery.iframe-transport.js') }}"></script>
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/jquery.fileupload.js') }}"></script>
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
<script type="text/javascript">
$(document).on('change', '.btn-file :file', function() {
var input = $(this),
numFiles = input.get(0).files ? input.get(0).files.length : 1,