This is a migrated thread and some comments may be shown as answers.

PHP Upload error

3 Answers 65 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Simone
Top achievements
Rank 1
Simone asked on 25 Nov 2013, 04:32 PM
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

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 26 Nov 2013, 11:14 AM
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!
0
Simone
Top achievements
Rank 1
answered on 26 Nov 2013, 10:41 PM
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
0
Dimiter Madjarov
Telerik team
answered on 27 Nov 2013, 11:25 AM
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!
Tags
Upload
Asked by
Simone
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Simone
Top achievements
Rank 1
Share this question
or