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();
$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.