Friends, the situation is this. There is a script that wants to upload a file to the server on the command of the form. As described in the documentation (which is very poor), the POST download method is understandable. Unfortunately, I don’t understand how I can get it on my side, since I don’t see it in the documentation, and I can’t look into the middle either, what is the name of the file that will be downloaded. Is there any way to bypass this and load all the files that will be received by such a command?
http://domain.com/index.php?r=Terminals/Upload&id=1111 Processing those files that have a name I do like this (uploading an avatar for example):
if(is_uploaded_file($_FILES["avatar"]["tmp_name"])) { $filename = $_FILES['avatar']['name']; mt_srand((double)microtime()*1000000); $img = ""; for ($i = 0; $i < 8; $i++) { $img .= chr(rand(97, 122)); } $newfilename = 'agent-'.$img; $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); move_uploaded_file($_FILES["avatar"]["tmp_name"], $_SERVER['DOCUMENT_ROOT']."/images/users/".$newfilename.$ext); }