GiovanniO Member Oct 8, 2025 #1 Hello everyone. I'm having an error in the HTTP Server example. When I try to upload a file to my phone from a web browser (on my PC connected to the same network), I get this error: HTTP ERROR: 500Problem accessing /upload/storage%2Femulated%2F0. Reason: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.iutputStream.close()' on a null object reference As I mentioned, it appears with the compiled example, meaning I haven't made any changes to it. Is there a solution? Thank you very much for any help. Best regards.
Hello everyone. I'm having an error in the HTTP Server example. When I try to upload a file to my phone from a web browser (on my PC connected to the same network), I get this error: HTTP ERROR: 500Problem accessing /upload/storage%2Femulated%2F0. Reason: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.iutputStream.close()' on a null object reference As I mentioned, it appears with the compiled example, meaning I haven't made any changes to it. Is there a solution? Thank you very much for any help. Best regards.
Erel B4X founder Staff member Licensed User Longtime User Oct 8, 2025 #2 Are you using the old HttpServer example? Better to avoid. Upvote 0
GiovanniO Member Oct 8, 2025 #3 Erel said: Are you using the old HttpServer example? Better to avoid. Click to expand... Thank you very much for your answer Erel. Yes, I'm using the Jetty-based HTTP server, since I need to upload and download a file from any computer in the LAN to an Android device acting as a server. Upvote 0
Erel said: Are you using the old HttpServer example? Better to avoid. Click to expand... Thank you very much for your answer Erel. Yes, I'm using the Jetty-based HTTP server, since I need to upload and download a file from any computer in the LAN to an Android device acting as a server.
Erel B4X founder Staff member Licensed User Longtime User Oct 9, 2025 #4 You can add a FTP server to your app: https://www.b4x.com/android/forum/t...d-with-socket-and-asyncstreams.74320/#content Upvote 0
You can add a FTP server to your app: https://www.b4x.com/android/forum/t...d-with-socket-and-asyncstreams.74320/#content
GiovanniO Member Oct 9, 2025 #5 Erel said: You can add a FTP server to your app: https://www.b4x.com/android/forum/t...d-with-socket-and-asyncstreams.74320/#content Click to expand... Thank you so much Erel, but i need to upload a file from any PC. A little context: The app is designed to visit several different branches of a company, so some files need to be collected. The simplest solution is to set up a server on Android and have users upload the file there from their browser. Thanks again Erel. Upvote 0
Erel said: You can add a FTP server to your app: https://www.b4x.com/android/forum/t...d-with-socket-and-asyncstreams.74320/#content Click to expand... Thank you so much Erel, but i need to upload a file from any PC. A little context: The app is designed to visit several different branches of a company, so some files need to be collected. The simplest solution is to set up a server on Android and have users upload the file there from their browser. Thanks again Erel.