Rewind pointer to locate the problem! It seems that the rewind pointer has an error. what is the problem? The code is as follows: & nbsp; $ fpstrfopen (& quot; php: input & quot;, & quot; rb & quot ;);... $ binfread ($ fpstr, 2); read-only 2 bytes... fseek ($ fpstr, 0); an error is reported here. use the $ fp rewind pointer again to locate the problem!
It seems that the rewind pointer has an error. what is the problem?
The code is as follows:
$ Fpstr = fopen ("php: // input", "rb ");
...
$ Bin = fread ($ fpstr, 2); // read-only 2 bytes
...
Fseek ($ fpstr, 0); // error reported here
// Use $ fpstr Resource again
$ RealSize = stream_copy_to_stream ($ fpstr, $ tmp); // at this time, the newly created file is missing two bytes.
How to locate the pointer to the beginning of $ fpstr to complete the file.
------ Solution --------------------
$ Fpstr = fopen ("php: // input", "rb ");
Php: // input is the input stream
You cannot locate the stream.