cancel
Showing results for 
Search instead for 
Did you mean: 

Auhenticate ,call POST webscript from HTML form

aditya_chaudhar
Champ on-the-rise
Champ on-the-rise
Hi Forum
I have issue while calling POST webscript from my HTML/ASP pages  :
below are details :

My HTML code :
<javascript>
<table>
     <form action="http://localhost:8080/share/proxy/alfresco/sample/uploadNCDDocs" method="post" enctype="multipart/form-data"          accept-charset="utf-8">
       <tr><td>File:</td><td><input type="file" name="file"></td></tr>
       <tr><td>Title:</td><td><input name="title"></td></tr>
       <tr><td>Description:</td><td><input name="desc"></td></tr>
       <tr><td></td></tr>
       <tr><td><input type="submit" name="submit" value="Upload"></td></tr>
     </form>
   </table>

I have tried Ticket like , i get ticket by following manyually from below REST
ost:8080/alfresco/service/api/login?u=admin&pw=admin

and update my HTML form as ,
<form action="http://10.4.3.91:8080/alfresco/s/sample/uploadNCDDocs?alf_ticket=TICKET_e0b6243dff47d6aba71c7ec790f2..." method="post" enctype="multipart/form-data" accept-charset="utf-8">

</javascript>

but it still ask for authentication window.

I refer below jeff pots article
http://ecmarchitect.com/images/articles/alfresco-webscripts/web-script-article.pdf

here jpotts mentioned it may be cross domain scripting issue ,and provide 3 options
1) use script tag
2) use a proxy
3)use a callback mechanism

But i didnt understand how to do it..

Please help me to understand this options and if any other technique to use POST webscript from external HTML form.

Also what is wrogn i am doing while using ticket in URL???
1 REPLY 1

aditya_chaudhar
Champ on-the-rise
Champ on-the-rise
Hi Forum,
I have solved my problem.
I read more about alfresco ticketing and below facts solve my problem

1. POST webscript requires user authentication, guest is not possible.
2.Ticket expires when we restart server , In my case while calling my POST webscript at client side i first generate ticket using
http://10.4.3.91:8080/alfresco/service/api/login?u=admin&pw=admin

and then append in POST URL.

Thank you Forum i got answer browsing many posts on this forum.

Thank You all Forum guys.


Thanks and Regards
Aditya C