Upload something working file in php

I know that sounds weird. I have a php file on my server that is responsible for handling downloads. And the java program on my desktop sends the files to this php file. I want to cancel the process of uploading a file to the server whenever I want. So I want to create some kind of thread or something like that to stop the current boot process.

I tried to use the PID to stop the php file from working. But the php file does not start before the client completes the download.

I want to run the savePid () function before starting the download. Therefore, I can get the PID and terminate the file when I want.

<?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 this will not work. I'm just looking for a solution to stop the current boot process.

+4
2

, .

:

20 , 2 . java URL- , php, . php , ( image_cancel prev table, - false) image_cancel /. , . script cancel_image.php --- > image_cancel true.

0

.

, , .

:
2 PHP, ( ), - . script, , , script. , . , PHP, . . , , .

:
-. apache, ( - apache). -, . - , , , .

0

Source: https://habr.com/ru/post/1626488/


All Articles