Commit 4127549c authored by Andrey Filippov's avatar Andrey Filippov

Fixing too long file list

parent 71aa9c6d
......@@ -48,6 +48,7 @@ preg_match_all('/url="([^\s]+('.implode('|',$TEXTURE_EXTENSIONS).'))"/i',$conten
// make a string
foreach($matches[1] as $v){
// $filestring .= " \\\n$path/$v"; // split lines do not help, limit is for the php string length in shell_exec()
$filestring .= " $path/$v";
}
......@@ -60,6 +61,11 @@ $mtlfile = substr($file,0,-3)."mtl";
if (is_file($mtlfile)) $filestring .= " $mtlfile";
$zipped_data = `zip -qj - $filestring `;
if (strlen($zipped_data) == 0){
$filestring=$path."/*.*"; // too long filestring, just compress everything in the model directory
$zipped_data = `zip -qj - $filestring `;
}
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="'.$zipfile.'"');
echo $zipped_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment