我想在Symfony 2.2中實現Blueimp/jQueryFileUploader。我發現了一個捆綁包,但它實際上並沒有在Symfony2上工作(根據創作者的說法,尚未支持)。Symfony2&Blueimp/jQueryFileUpload:如何實現默認上傳器?
無論如何,我想在我的應用程序中使用該上傳器的默認版本。我將文件添加到/ web的捆綁文件夾中,並且我可以看到包含Bootstrap中按鈕的頁面。但是,當涉及到的Javascript,它只是拋出此異常:
Unexpected character ";" in SitePersoBundle:Default:file_upload.html.twig at line 77 500 Internal Server Error - Twig_Error_Syntax
行77載:
{% for (var i=0, file; file=o.files[i]; i++) { %}
我所做的是複製/粘貼演示的源代碼,這樣我就可以測試,但它會拋出上面的異常。這是爲什麼 ?
這裏的鏈接了jQuery上傳Github上:https://github.com/blueimp/jQuery-File-Upload
所以..有沒有人有一個想法? – Sherlock 2013-04-27 13:22:29
是的,你爲什麼要把'for(var i = 0,file; file = o.files [i]; i ++){'inside blocks('{%''%}')? – 2013-04-27 17:14:05
我沒有,這是如何寫腳本。查看源代碼:http://blueimp.github.io/jQuery-File-Upload/ – Sherlock 2013-04-27 17:35:06