Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Transfer API

Hi,

 

The following code does not want to work on the Orion server (http://download.eclipse.org/orion/):

 

var files = document.getElementById("fileinput").files;

                        if (files[0]) {

                                   var r = new FileReader();

                                   r._onload_ = function(e) {

                                               var contents = e.target.result;                                   

                                               $.ajax({

                                               url: "http://localhost:8080/xfer/import/User/Folder",

                                               type: 'POST',

                                               data: contents,

                                               headers: {

                                                           "Orion-Version": "1",

                                                           "Content-Type": "application/zip"                 

                                               },

               

                                               success: onComplete,

                                               error: onError

                                               });

                                   }

                                   r.readAsText(files[0]);

                        }

 

The error is:

{"readyState":4,"responseText":"{\"Severity\":\"Error\",\"Message\":\"Failed to complete file transfer on User/Folder/a.zip\",\"HttpCode\":400,\"Code\":0,\"DetailedMessage\":\"error in opening zip file\"}","status":400,"statusText":"Bad Request"} - error - Bad Request

 

Can anybody help me with the problem?

 

Thanks in advance,

Vitaly

 

 


Back to the top