We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I am trying to host a website but there is a issue with the mime type.
here is the code : We have the code in the www folder
package com.example.sample.photolab; import android.os.Environment; import android.util.Log; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileReader; import java.nio.charset.StandardCharsets; import java.util.Map; import fi.iki.elonen.NanoHTTPD; public class HTTP_SERVER extends NanoHTTPD { public HTTP_SERVER(int port) { super(port); } public HTTP_SERVER(String hostname, int port) { super(hostname, port); } @Override public Response serve(IHTTPSession session) { //String msg = "<html><body><h1>Hello server</h1>\n"; Map<String, String> parms = session.getParms(); /*if (parms.get("username") == null) { msg += "<form action='?' method='get'>\n"; msg += "<p>Your name: <input type='text' name='username'></p>\n"; msg += "</form>\n"; } else { msg += "<p>Hello, " + parms.get("username") + "!</p>"; }*/ return newChunkedResponse(Response.Status.OK,"text/html",new ByteArrayInputStream(web_page().getBytes(StandardCharsets.UTF_8))); } private String web_page(){ String answer = ""; try { // Open file from SD Card File root = Environment.getExternalStorageDirectory(); FileReader index = new FileReader(root.getAbsolutePath() + "/www/index.html"); BufferedReader reader = new BufferedReader(index); String line = ""; while ((line = reader.readLine()) != null) { answer += line; } reader.close(); } catch(Exception ioe) { Log.e("Httpd", ioe.toString()); } return answer; } }
This is a ### MIME type error but one thing i can see that the files are getting indexed.
Thanks
The text was updated successfully, but these errors were encountered:
www.zip here is the website code
Sorry, something went wrong.
No branches or pull requests
Hello,
I am trying to host a website but there is a issue with the mime type.
here is the code :
We have the code in the www folder
This is a ### MIME type error but one thing i can see that the files are getting indexed.
Thanks
The text was updated successfully, but these errors were encountered: