I am uploading a file to my server using VB6 and Winsock.
The upload works fine.Code:POST /upload.php? HTTP/1.0 Host: somedomain.com Content-Type: multipart/form-data, boundary=uzTxw5X5HVmtcWrFhatyjH2QGVcMlBj2 Content-Length: 127289 --uzTxw5X5HVmtcWrFhatyjH2QGVcMlBj2 Content-Disposition: form-data; name="file"; filename="C:/Program Files (x86)/Microsoft Visual Studio/VB98/dtctlsu.oca"; realpath="C:/Program Files (x86)/Microsoft Visual Studio/VB98/dtctlsu.oca" Content-Type: application/octet-stream --uzTxw5X5HVmtcWrFhatyjH2QGVcMlBj2--
On the server, I would like to know the file's path on the client pc (=> "C:/Program Files (x86)/Microsoft Visual Studio/VB98/dtctlsu.oca").
That is why I have tried to add a custom field named "realpath" (realpath="C:/Program Files (x86)/Microsoft Visual Studio/VB98/dtctlsu.oca")
I have tried to get this field in my php script, but it's empty.
How could I pass a custom field with my POST?Code:<?php move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/" . $_FILES["file"]["name"]); $path = "uploads/"; $name = $_FILES["file"]["name"]; $fullpath1 = $_FILES["file"]["realpath"]; $fullpath2 = $_POST["realpath"]; echo "fullpath: . $fullpath1"; echo "fullpath: . $fullpath2"; ?>
Thank you!
ps: I don't have access to php 8.1 yet, so I can't use "full_path".




Reply With Quote
