Hi,
I would to pass a different targetpath to uploadHander php function from program. ( actually target_path variable is fixed inside UploadHandler function)
How i can do it ??
Many thanks
It is not a good idea to pass the path from the client side - someone could use this vulnerability.
But you can do it using the “setFormField” method and then use its value on the server side.
Sorry but i don’t undertand…
When i use setFormField method, i have in UploadHandler possibiilties to retrieve a content of field ?
for example:
vault.setFormField(“comune”, “vespolate”);
UploadHandler :
<?php $id = $_GET['sessionId']; $id = trim($id); session_name($id); session_start(); $inputName = $_GET['userfile']; $fileName = $_FILES[$inputName]['name']; $tempLoc = $_FILES[$inputName]['tmp_name']; echo $_FILES[$inputName]['error']; // here i retrieve value $comune = $_GET['comune']; $target_path = 'd:\\xampp\\htdocs\\Taxsuitecloud\\Upload\\'.$comune.'\\'; $target_path = $target_path . basename($fileName); if(move_uploaded_file($tempLoc,$target_path)) { $_SESSION['value'] = -1; } ?>can you explane better ??
Many thanks
Yes, similar but you should use
$comune = $_POST[‘comune’];