Java – upload running files in PHP

I know it sounds strange There is a PHP file on my server, which is responsible for processing the upload The Java program on my desktop sends the file to this PHP file I want to cancel the file upload process to the server at any time So I want to create a stream or something similar to prevent the ongoing upload process

I tried to use PID to prevent PHP files from running However, the PHP file did not start running until the client finished uploading

I want to run the "savepid()" function before the upload starts So I can get the PID and stop running the file at any time

<?PHP
include('func.PHP');
savePid(); //run this before upload started

$in = stream_get_contents(fopen("PHP://input","rb"));
$out = fopen('pipeupload.txt','w');

while ( ! feof($in) ) {
    fwrite($out,fread($in,8192));
}
?>

I know it won't work I'm just looking for a solution to stop the ongoing upload process

Solution

It may be on the server side

Example:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>