Suppress half a day to suppress such a bit of code, temporarily make it possible to use ... You need to manually delete the delimiter at the end of the file, as well as a newline of windows:
#!/bin/Bashnewline="" while true; DoRead newline Line_start=$(ExprSubstr"$newline" 1 6) if[${line_start}x = ="------x"]; Then Echo "Got theBoundary"#just Throw the follow lines away read newline read newline read newline tofile=new.Tar. GZCat>$toFilefi Done
Let's do this for the time being, and be more careful when you are free.
PS: After accepting tar.gz according to the above code, TAR can be decompressed normally, then prompt:
Gzip:stdin:decompression OK, trailing garbage ignored
However, there is no problem, that is, Gzip did not when this is a thing.
if " ${line_start}x " " Content-lengthx " ]; then Echo " content-length seg. is found " length=$ (echo $newline | Sed's/[^0-9]//g')
The HTML code uses this:
<Metahttp-equiv=content-typecontent= "Text/html;charset=utf-8"><HTML><Body><formenctype= "Multipart/form-data"Action= "Http://localhost/UploadFile"Method= "POST">file1:<inputtype= "File"name= "File1"><BR><inputtype= "Submit"value= "Upload"><inputtype= "Reset"value= "Reset"></form></Body></HTML>
HTTP file upload using BASH as CGI