Android Question Upload file to asp.net webservice using job.posfile (httputils2)

Discussion in 'Android Questions' started by Xicu, Mar 18, 2015.

  1. Xicu

    Xicu Member Licensed User

    I can upload a file using poststring like I explain in http://www.b4x.com/android/forum/threads/solucionado-subir-archivo-a-webservice-asp-net.44683/ .
    There I call the webservice using job.poststring + SOAP.

    Now I want try with job.postfile without SOAP and using the same webservice (if it's possible)
    Code:
    Sub UploadFile()
      job1.PostFile(
    "http://www.myweb.com/xxxx.asmx/uploadfile",File.DirRootExternal, "Prueba.txt")
    End Sub
    but I receive Internal Error Server (and the file exits in the dir).
    I know that postfile works with php webservice, and I think that the problem is in the asp.net webservice.
    Have somebody an idea to make the correct webservice with the correct parameters to use postfile?
    Is postfile the best way to upload files or its better use the SOAP like the first link?

    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    PostFile creates a POST request with the file as the request payload. If your server isn't configured to accept such requests then it will not work.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice