NoteOnMe博客平台搭建
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

39 rader
998 B

<?php
#$cmd = "/Users/iris/anaconda3/envs/venv/bin/python3.6 /Users/iris/im2latex_master2/demo2.py --test_data_path ".$_FILES['file']['tmp_name']." 2>&1 ";
if(!empty($_FILES['file']['name'])){
//判断是否有文件
$fileinfo = $_FILES['file']; //将文件信息赋给变量$fileinfo
if($fileinfo['size']<2000000 && $fileinfo['size']>0){ //判断文件大小
# if(move_uploaded_file($_FILES["file"]['tmp_name'],"image/".$fileinfo['name']))
# {
# $filepath="/app/image/".$fileinfo['name'];
#$cmd = 'cd /Users/iris/im2latex_master ';
#unset($out);
#$res=exec($cmd, $out);
#var_dump($res);
#echo '------';
#var_dump($out);
#echo '------';
unset($out);
$cmd = "python3 im2latex_master/demo2.py --test_data_path ".$_FILES['file']['tmp_name']." 2>&1 ";
$res=exec($cmd, $out,$return_status);
var_dump($out);
var_dump($return_status);
$data = json_decode($res, true);
echo $data['res'];
#ç '------';
}
}