When you use php to execute shell script to handle file, the filename may have to be preprocessing due to a few special characters.

$fileAttr = $_FILES['fileObj'];
$target_dir = "upload";
$chars=array("/【/", "/】/", "/:/", "/!/", "/?/", "/ /", "/\(/", "/\)/", "/(/", "/)/", "/,/", "/,/", "/-/", "/-/");
$fileName = preg_replace( $chars, '_' , $fileAttr["name"] );
$target_basename = basename($fileName);
$upload_file = $target_dir . "/" . $target_basename;

It’s better to set character encoding before running shell command.

$cmdStr = 'export LANG=en_US.UTF-8; handle ' . $upload_file 
Categories: ShellTool

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X
0
Would love your thoughts, please comment.x
()
x