블렌더에서 사용자가 업로드 한 파일을 열어야합니다 (데이터 검색 및 처리 용).PHP에서 동적 파일 열기
지금까지 $ cmd를 생성하고 exec(); 테스트를 위해 일했지만 실행중인 파일이 항상 미리 정의되어 있으므로 사용자가 업로드 한 파일을 열어 볼 수 없습니다 (C : \ xampp \ htdocs \ test.new \ test.stl).
$cmd = '"C:\Users\DJ LX\Documents\blender.old\blender.exe" C:\xampp\htdocs\test.new\test.stl"';
if ((($_FILES["file"]["type"] == "application/netfabb")
|| ($_FILES["file"]["type"] == "application/sla")
|| ($_FILES["file"]["type"] == "fileapplication/sla")
|| ($_FILES["file"]["type"] == "fileapplication/vnd.ms-pki.stl")))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $file . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"]/1024) . " kB<br>";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
exec($cmd);
$ _FILES 정보를 사용해 보았지만 작동하지 않습니다.
$cmd = "C:\Users\DJ LX\Documents\blender.old\blender.exe" $_FILES["file"]["type"];
및
$cmd = "C:\xampp\htdocs\test.new\upload" . $_FILES["file"]["type"];
또한 사용은 $ openfile, 다음 간부 ($ openfile)를 사용하여로 지정 fopen을 시도했지만 오류가 간부의 첫번째 매개 변수() 할 필요가 없다는 표시
끈이어야한다.
$openfile = fopen($_FILES["file"]["type"], "r");
if ((($_FILES["file"]["type"] == "application/netfabb")
|| ($_FILES["file"]["type"] == "application/sla")
|| ($_FILES["file"]["type"] == "fileapplication/sla")
|| ($_FILES["file"]["type"] == "fileapplication/vnd.ms-pki.stl")))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $file . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"]/1024) . " kB<br>";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
exec($opefile);
어쨌든, 내가 업로드 한 파일에서 파일 이름을 파일을 열도록 사용할 수있는 방법에 대한 정말 혼란 스러워요. 어떤 도움이라도 대단히 감사하겠습니다.
시도했지만 여전히 작동하지 않습니다. –