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

Raw Data with Kendo Upload

8 Answers 763 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 06 Mar 2012, 04:17 PM
Maybe I am doing something wrong or I am missing something, but do I have to provide a save URL or can I just get the bytearray of the file when it is done uploading?

I do not see an event/property/method that will give me access to the data that has been uploaded.

8 Answers, 1 is accepted

Sort by
0
Jeremy
Top achievements
Rank 1
answered on 09 Mar 2012, 05:24 PM
Does anyone else have an example of a handler that is working so I can take a look at it? Or does it work without the handler?

I can't seem to get this to work either.
0
T. Tsonev
Telerik team
answered on 12 Mar 2012, 10:54 AM
Hi,

The file content can't be accessed on the client. A handler is required.

Jeremy, what server technology do you use? We have samples for PHP and the server-side code from our ASP.NET MVC Upload examples can be used as-is.

All the best,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 12 Mar 2012, 02:08 PM
Do you have a sample that uses a wcf web service? I keep getting an exception message saying ""The incoming message has an unexpected message format 'Raw'. The expected message formats for the operation are 'Xml', 'Json'."
0
T. Tsonev
Telerik team
answered on 13 Mar 2012, 02:57 PM
Hello,

No, we don't have an example with WCF services. That said, the request sent by the upload is indistinguishable from a normal form POST. A service that can handle a normal upload should do.

This is an example of such service. I'm sure you can find more.

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 13 Mar 2012, 04:31 PM
I understand that it is a simple post, but what is the message format so I know which parameters to include in my service method.
0
T. Tsonev
Telerik team
answered on 15 Mar 2012, 10:11 AM
Hi,

There is no specific message format. The POST request contains one or more form fields for each uploaded file:
Content-Type:multipart/form-data; boundary=----WebKitFormBoundary8ChKTJYdlPVAv4cd
...
------WebKitFormBoundary8ChKTJYdlPVAv4cd
Content-Disposition: form-data; name="uploadName"; filename="test.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
------WebKitFormBoundary8ChKTJYdlPVAv4cd-- 


You need to look for a form fields with the name of the upload component.

I hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 24 Mar 2012, 09:47 PM
It still just tells me bad request.

            $("#UserPicture").kendoUpload({ 
                        async: {
                            saveUrl: "Services/RockService.svc/Upload",
                            autoUpload: true
                        }
                    }) 

    <OperationContract()>
    Public Sub Upload(ByVal data as SomeType)

'i would have code here to check the context.a request.files, but it never gets here
    End Sub

The bigger question in all of this is, can i only send the file without other data to accompany it? I am trying to save a picture with a user profile, but it looks like i am going to have to make 2 posts, one for the form and one for the picture upload? that can't be right.
0
T. Tsonev
Telerik team
answered on 27 Mar 2012, 12:21 PM
Hi,

Are you able to upload a file to the service using a form submit? I don't think this is specific to the Kendo UI Upload.

I believe WCF does not know about multipart requests, so you'll have to parse the request yourself. This answer on SO shows how to configure the service to accept such requests.

I hope this helps.
 
Greetings,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Joshua
Top achievements
Rank 1
Answers by
Jeremy
Top achievements
Rank 1
T. Tsonev
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or