PHP Upload error

4 posts, 0 answers
  1. Simone
    Simone avatar
    2 posts
    Member since:
    Nov 2013

    Posted 25 Nov 2013 Link to this post

    Hi, I'm trying to create an asynchronous upload button via php wrapper. Even copying your example codes, and even running demos in downloaded zip file, I always get this error in browser (chrome latest version):

    Uncaught SyntaxError: Unexpected token ]

    Just in generated line:

    <input type="file" id="" name="" /><script>jQuery(function(){jQuery("#").kendoUpload({"upload":files[],"async":{"saveUrl":"save.php"}});});</script>


    I couldn't find anything useful to solve this problem.
    Please can you help me?

    Warm regards,
    Simone
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 26 Nov 2013 Link to this post

    Hello Simone,


    Have you set the name of the Upload widget? It is used as id and name attributes for the input element, which are empty in the current example.
    E.g.
    $upload = new \Kendo\UI\Upload('files[]');
     
    echo $upload->render();

    I hope this information helps. Have a great day!

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
  4. Simone
    Simone avatar
    2 posts
    Member since:
    Nov 2013

    Posted 26 Nov 2013 Link to this post

    Hi Dimiter, I'm using your example code from http://docs.kendoui.com/getting-started/using-kendo-with/php/widgets/upload/modes#remove-handler
    <?php
    $upload = new \Kendo\UI\Upload('files[]');
    $upload->async(array(
            'saveUrl' => 'save.php',
            'removeUrl' => 'remove.php',
            'removeField' => 'fileNames[]'
    ));
    ?>
    which gives me, after $upload->render(), the result I posted:
    <input type="file" id="" name="" /><script>jQuery(function(){jQuery("#").kendoUpload({"upload":files[],"async":{"saveUrl":"save.php","removeUrl":"remove.php","removeField":"fileNames[]"}});});</script>
    anything else I could check?
    Thanks
    warm regards,
    Simone
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 27 Nov 2013 Link to this post

    Hi Simone,


    I am not sure what could be the reason for this strange issue. It is not reproducing in the Q3 demos on our side. In order to assure that everything is setup correctly, you could check the following getting started page.

    If the problem is still persisting, please send me a small sample project, where it is reproducing, so I could inspect it locally and pinpoint the exact reason for it.

    I am looking forward to hearing from you.

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET AJAX banner