Home Backend Development PHP Tutorial rewind指针定位有关问题

rewind指针定位有关问题

Jun 13, 2016 pm 01:48 PM
input quot rewind stream

rewind指针定位问题!
好像rewind定位指针报错 什么问题?
代码如下:
 $fpstr = fopen("php://input", "rb");
...略
$bin = fread($fpstr, 2); //只读2字节
...略
fseek($fpstr,0); //这里报错

//这里需要再次使用$fpstr资源
$realSize = stream_copy_to_stream($fpstr, $tmp); //此时新建的文件少了两个字节  

怎么定位指针到$fpstr开头处啊 使文件完整.

------解决方案--------------------
$fpstr = fopen("php://input", "rb");

php://input 是输入流
你不可能对 流 做定位操作

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1270
29
C# Tutorial
1250
24
How to debug Java Stream operations in IntelliJ IDEA How to debug Java Stream operations in IntelliJ IDEA May 09, 2023 am 11:25 AM

Stream operation is a highlight of Java8! Although java.util.stream is very powerful, there are still many developers who rarely use it in actual work. One of the most complained reasons is that it is difficult to debug. This was indeed the case at the beginning, because streaming operations such as stream cannot be used in DEBUG When it is one line of code, when it comes to the next step, many operations are actually passed at once, so it is difficult for us to judge which line in it is the problem. Plug-in: JavaStreamDebugger If the IDEA version you are using is relatively new, this plug-in is already included and does not need to be installed. If it is not installed yet, install it manually and then continue below.

How to implement laravel input hidden field How to implement laravel input hidden field Dec 12, 2022 am 10:07 AM

How to implement the laravel input hidden field: 1. Find and open the Blade template file; 2. Use the method_field method in the Blade template to create a hidden field. The creation syntax is "{{ method_field('DELETE') }}".

How to encapsulate input components and unified form data in vue3 How to encapsulate input components and unified form data in vue3 May 12, 2023 pm 03:58 PM

Preparation Use vuecreateexample to create a project. The parameters are roughly as follows: use native input. Native input is mainly value and change. The data needs to be synchronized when changing. App.tsx is as follows: import{ref}from'vue';exportdefault{setup(){//username is the data constusername=ref('Zhang San');//When the input box changes, synchronize the data constonInput=;return( )=>({

How to get max value from stream in java8 How to get max value from stream in java8 May 14, 2023 pm 03:43 PM

java8's stream takes maxpublicstaticvoidmain(String[]args){Listlist=Arrays.asList(1,2,3,4,5,6);Integermax=list.stream().max((a,b)->{if (a>b){return1;}elsereturn-1;}).get();System.out.println(max);}Note: The size is determined here through positive and negative numbers and 0 values. Instead of writing it directly if(a>b){returna;}elseretur

What to do if there is no cursor when clicking on the input box What to do if there is no cursor when clicking on the input box Nov 24, 2023 am 09:44 AM

Solutions for clicking the input box without a cursor: 1. Confirm the focus of the input box; 2. Clear the browser cache; 3. Update the browser; 4. Use JavaScript; 5. Check the hardware device; 6. Check the input box properties; 7. Debug JavaScript code; 8. Check other elements of the page; 9. Consider browser compatibility.

What does stream mean in linux? What does stream mean in linux? Mar 17, 2023 am 09:55 AM

In Linux, stream means data flow, which is a string of data read in a certain order, so the direction of the data flow is the reading order of the data flow. The process of the Linux system importing the output results after reading the data into other files is called redirected data flow. After a command is entered and run under Linux, two results will be displayed on the screen: the result of a successful operation is the standard output, and the result of a failed operation is the standard error output; if not processed, they will be displayed on the screen and redirected through the data stream. You can save it to other files.

Is Microsoft introducing trimmed video in Microsoft Stream (on SharePoint)? Here's what the new roadmap update says Is Microsoft introducing trimmed video in Microsoft Stream (on SharePoint)? Here's what the new roadmap update says Nov 24, 2023 pm 11:13 PM

In an updated entry on the Microsoft 365 Roadmap website (Feature ID: 186956), the Redmond-based tech giant said the feature will give users editing permissions to trim the beginning, end, and any clips in a video. "When you trim a video, Stream does not change the original video file itself. Instead, it simply hides the trimmed portion from the viewer," the update reads. You can then try out this feature by launching a video in the StreamWeb app and clicking the edit button once the rollout is complete over the next few months. The roadmap update states that the rollout will begin in "March 2023." However, given that the roadmap entry was added on November 21, 2023

PHP function introduction—rewind(): Reposition the file pointer to the beginning of the file PHP function introduction—rewind(): Reposition the file pointer to the beginning of the file Jul 24, 2023 pm 04:01 PM

PHP function introduction—rewind(): Reposition the file pointer to the beginning of the file. In PHP, we often need to handle file operations. PHP provides a wealth of functions to operate files, one of which is the rewind() function. The rewind() function is used to relocate the file pointer to the beginning of the file in order to re-read the file content or perform other file operations. Below we will introduce the use of the rewind() function in detail and provide some code examples to help you better understand the function.

See all articles