Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /var/www/html/manage/person/admin/ drwxr-xr-x |
Viewing file: downloadDoc.php (6.49 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | //----select doc status = r2 start download $oTsr->SearchByKey($tsr_id); while($oTsr->GetRecord()){ $tsr_id =$oTsr->tsr_id; $tsr_docid =$oTsr->tsr_docid; $tsr_doc_url=$oTsr->tsr_doc_url; $tsr_doc_chksum=$oTsr->tsr_doc_chksum; $tsr_fr_node=$oTsr->tsr_fr_node; $tsr_docname=$oTsr->tsr_docname; $tsr_statusDocAtt=$oTsr->tsr_statusDocAtt; $oCd->SearchByKey($oTsr->tsr_fr_node); $oCd->GetRecord(); //---download each Doc $i=0; while($tsr_doc_url!=''){ list($downloadurl,$tsr_doc_url)=split(',',$tsr_doc_url,2); list($downloadfilename,$tsr_docname)=split(',',$tsr_docname,2); list($downloadchksum,$tsr_doc_chksum)=split(',',$tsr_doc_chksum,2); $checktsr_statusDocAtt.='Y'; $i++; $count=strlen($tsr_statusDocAtt); if($count!=$i){ $statusDoc = substr($tsr_statusDocAtt,$i-1,-($count-1-($i-1))); }else{ $statusDoc = substr($tsr_statusDocAtt,$count-1); } if($statusDoc=='N'){ if(downloadRemoteFile($tsr_fr_node,$downloadurl, "../documentsTmp")==true){ $file_name = basename($downloadurl); $file_name_write=$file_name; $filename_=''; $filetype_=''; list($filename_,$filetype_)=split('[.]',$file_name_write); $filewrite=$filename_.'-'.$tsr_fr_node.'.'.$filetype_; $fileN=substr(strrchr($downloadurl, '/'),1); $pathfile="../documentsTmp/".$filewrite; $checksum=md5_file($pathfile); $c=0; if($downloadchksum==""){ $c=1; } if(($checksum==$downloadchksum) || $c==1){ //--update tsr_statusDocAtt $count=strlen($tsr_statusDocAtt); if($count!=$i){ $tsr_statusDocAtt = substr_replace($tsr_statusDocAtt, "Y", $i-1,-($count-1-($i-1))); }else{ $tsr_statusDocAtt = substr_replace($tsr_statusDocAtt, "Y", $count-1); } $oTsr2->SearchByKey($oTsr->tsr_id); $oTsr2->GetRecord(); $oTsr2->Edit(); $oTsr2->tsr_statusDocAtt=$tsr_statusDocAtt; $oTsr2->Save(); $oTsr2->Close(); //echo " |
>>>>> ดาวน์โหลดเอกสารสมบูรณ์ <<<<< |
>>>>> เอกสารที่ดาวน์โหลดมาไม่สมบูรณ์ <<<<< |
>>>>> ไม่สามารถดาวน์โหลดเอกสารได้ <<<<< |