B4J Tutorial [Server] Upload files from your B4A app to your B4J server over the internet

Discussion in 'B4J Tutorials' started by Erel, Jan 28, 2014.

Thread Status:
Not open for further replies.
  1. LucaMs

    LucaMs Expert Licensed User

    I had forgotten to disable the Windows firewall.

    But now instead of getting the "timeout" I get the "refused"
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Hard to say. Something is misconfigured in your network configuration.
     
  3. LucaMs

    LucaMs Expert Licensed User

    Yes, I understand that it is impossible for you to help me in this case.

    However, I receive an error warning message from the server B4j. However, it responds using 127...

    2014-07-24 07:39:12.578:WARN:eek:ejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale it_IT

     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Ignore these messages. They are not related.
     
  5. LucaMs

    LucaMs Expert Licensed User


    I know, unfortunately :(
     
  6. LucaMs

    LucaMs Expert Licensed User

    Port problem still not resolved.

    Moreover, it seems that to get closer to the port I am forced to disable the router's firewall!
     
  7. LucaMs

    LucaMs Expert Licensed User

    Dear Maxware was able to access my server from his browser.
    But I misunderstood or should even I be able to do it from my browser (even if the server is running on my pc)?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    You should be able to access your local server from the browser. Start with 127.0.0.1. If it works then try your external ip address. If it doesn't work then your router / firewall are misconfigured.
     
  9. LucaMs

    LucaMs Expert Licensed User


    Yes, these are the steps that you wrote in the first post and I have tried.

    So, I have successfully used 127.0.0.1 (localhost) but it does not work using the WAN address of the router, even though the port is open and calls directed to this port are sent to the computer which the server is installed and despite outside of my local network it is accessible.

    However, I solve using the fixed address of the server pc for my tests (from mobile clients).

    Thanks Erel
     
  10. Giacomo Cuciniello

    Giacomo Cuciniello Member Licensed User

    there is a way to use variables or function declared in Main (in fileserver program) in the "class module" "Upload"?
    it seem to see only variables declared in in class module.
    Thanks for help
     
  11. LucaMs

    LucaMs Expert Licensed User

    If I understood well (better in Italian :)) you want to call Main's routines from the Upload class?

    If so, it probably is not the best choice. Equally probably... just try it ;) (it should be possible, i'll try it soon. Surely it is possible using CallSubDelayed)


    [P.S. Tried. It's possible]
     
    Last edited: Sep 8, 2014
  12. Giacomo Cuciniello

    Giacomo Cuciniello Member Licensed User

    thank you for your quick answer.
    I need to read the value of a variable that is modified in the main inside the handler module so that I can send this value to the client.
    (devo vedere il valore di una variabile del main per inviarlo al client tramite l'handler ma l'handler vedere solo le variabili locali e non ha accesso alle variabili del main).(callsubdelayed mi consente di ricevere il risultato della sub?)
    I hope it is more clear now.
    thanks for your help
     
  13. LucaMs

    LucaMs Expert Licensed User

    You could declare the variable as public global in the main or call a function of the main and get the result.

    Puoi semplilcemente dichiara una variabile pubblica globale nel Main e leggerla da qualunque altro modulo oppure richiarmare una funzione scritta nel Main (senza usare CallSubDelayed, semplicemente il nome della funzione).
     
  14. Giacomo Cuciniello

    Giacomo Cuciniello Member Licensed User

    I already tried this way but the editor and the compiler don't recognize the variable in the module.
    I think that I solved using "Main." before variable name.
    (Sero di aver risolto aggiungendo Main. prima del nome della variabile nel modulo handler, lo sto testando)
    Thanks
     
  15. LucaMs

    LucaMs Expert Licensed User

    That's right. I did not think to write it.

    Esatto. Non ho pensato a scriverlo :)
     
  16. TAK

    TAK Member Licensed User

    Hello,
    how does this example work? With TCP?
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    Http (over TCP).
     
    TAK likes this.
  18. YIM bunchhat

    YIM bunchhat Active Member Licensed User

    Hello, when I compile I got this error.
    upload_2014-10-17_11-11-0.png
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    Which version of B4A are you using?
     
  20. YIM bunchhat

    YIM bunchhat Active Member Licensed User

Thread Status:
Not open for further replies.
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