B4J Question Downloading a file from secured server

Discussion in 'B4J Questions' started by Beja, Mar 31, 2015.

  1. Beja

    Beja Expert Licensed User

    Hello friends..

    Is it possible in B4J to download an excel file from a secured site with user id and pwd? I appreciate if you point me
    to a link to a post.. I couldn't see one.

    best..

    p.s.
    I just started experimenting with b4j and need a headstart.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    How does the authentication work? Do you need to fill a form with the user name and password?
     
  3. Beja

    Beja Expert Licensed User

    Hi Erel,
    Yes, I need to fill a small form that pops up when try to download the file, the same form from B4X when try to download some material before login in.
    So yes, I need to know how to fill the form with the authentication ID/PWD, and download the file.
    I would appreciate it if you showed a simple project to download the picture in the following URL by storing the UI and PWD and then automate the downloading process.
    thanks in advance.
    http://www.b4x.com/android/forum/attachments/back-png.33898/
     
    Suntzu likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    The process is specific to each web site. You will need to first learn what happens when you submit the form (use FireBug to track the network calls) and then send the same request in your code.
     
  5. Beja

    Beja Expert Licensed User

    I think I know what happens when I submit the form, the website will response with "Thank you for submitting" ;)
    but how to fill the form in the first place.. I used to use "Sendkeys".. it works with something like ms word or notepad or any single document, but when it comes to fields then it is very difficult.. now using trial and error to send a number of "TABs" to get to the filed I want.. but it's not professional and looking for a better way.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You need to use FireBug with FireFox and monitor the Net tab. It will show you the request that is being sent.
     
    Beja likes this.
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