cancel
Showing results for 
Search instead for 
Did you mean: 

REST Cross domain call to upload file

ayubalfresco
Champ in-the-making
Champ in-the-making
I am using REST api to upload file. http://fiddle.jshell.net/876fzzd5/5/ is the pastebin.

I am using http://malsup.com/jquery/form/#file-upload form plugin to upload cross domain.

IE debug tools show that correct response received from the server. However success call back is always called. If I dont use cross domain ajax call then the correct call back methods are called.

Could some one let me know what might be the issue ?
2 REPLIES 2

christianjanker
Champ on-the-rise
Champ on-the-rise
Hey ayub,

i 'm quite new to alfresco, so just some things i noticed:

* For me that sounds like a jquery issue
* action="…./alfresco/wcservice/api/upload.post.html"  …. never heard about this service. I would use: http://docs.alfresco.com/community/references/RESTful-UploadUploadPost.html

* May u use Firebug / Chrome Dev Tools to see which requests/respones are sent and which HTTP response codes you get (200, 404, 500….) and compare cross-request vs. no-cross-request.
* May u use Postman (Chrome App) to build request by hand before and see if everything works

Greetings
Chris

Hi Christian,

I initially tried the /alfresco/service/api/upload url for file upload however in IE9 the response was being downloaded as a file. So I changed the url. I had to use /alfresco/wcservice as I am using SSO.

Thanks and Regards
Ayub