Open Walkline80 opened 3 months ago
BTW, although the prompt shows the space available, the progress bar shows progress that doesn't quite make common sense.
I think it's more acceptable to change it to this.
After two days of debugging, there is still no way to add the binary file to the firmware, I can only use the most common method, which is to use three quotes to save the web page and other files as python files, compile the firmware and then decompress the web page file, in order to reduce the file size so the
.js
and.css
file is compressed, the first problem was found in debugging, this line is missing a semicolon, which will lead to abnormal operation after compression.Another problem appeared here, when using download software (I'm using NDM) to download the file will always fails, after analysis, found that the http response header is missing the
Content-Length
field, after adding can solve this problem.I've already forked this repo, but I think it would be more convenient to leave an issue directly rather than submitting a pr?
Sorry for problems in my code. Can you send me updated source code of your changes in Content-Length ?
Here's my code, by replace this line.
client.send(f"HTTP/1.1 200 OK\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename=\"{file_name}\"\r\nContent-Length: {os.stat(file_path)[6]}\r\n\r\n")
After two days of debugging, there is still no way to add the binary file to the firmware, I can only use the most common method, which is to use three quotes to save the web page and other files as python files, compile the firmware and then decompress the web page file, in order to reduce the file size so the
.js
and.css
file is compressed, the first problem was found in debugging, this line is missing a semicolon, which will lead to abnormal operation after compression.Another problem appeared here, when using download software (I'm using NDM) to download the file will always fails, after analysis, found that the http response header is missing the
Content-Length
field, after adding can solve this problem.I've already forked this repo, but I think it would be more convenient to leave an issue directly rather than submitting a pr?