You are here:   Home Joomla Zone DOCMAN add auto rename when upload file
วันจันทร์ที่ 23 พฤษภาคม 2011 เวลา 22:40 น.

DOCMAN add auto rename when upload file Featured

Written by  GWA Info
Rate this item
(0 votes)

 

I found method to hack DOCMAN for unlock method checking file upload same name.

 

When you set [DOCMAN] configuration file upload overwrite.

 

You must to generate random filename or rename before upload this file to system.

 

Method: to looking file "DOCMAN_file.class.php"

on line 374

 

function copyFiles( $p_sourcedir, $p_destdir, $p_files, $overwrite=false )

{

if (is_array( $p_files ) && count( $p_files ) > 0) {

foreach($p_files as $_file) {

$filesource = mosPathName( mosPathName( $p_sourcedir ) . $_file, false );

$filedest   = mosPathName( mosPathName( $p_destdir ) . $_file, false );
if (!file_exists( $filesource )) {

$this->setError( 1, "File $filesource does not exist!" );

return false;

} else if (file_exists( $filedest ) && !$overwrite) {

$this->setError( 1, "There is already a file called $filedest - Are you trying to install the same CMT twice?" );

return false;

} else {

$path_info = pathinfo($_file);

if (!is_dir( $path_info['dirname'] )){

mosMakePath( $p_destdir, $path_info['dirname'] );

}

if( !( copy($filesource,$filedest) && mosChmod($filedest) ) ) {

$this->setError( 1, "Failed to copy file: $filesource to $filedest" );

return false;

}

}

}

} else {

return false;        }

return count( $p_files );    }

 


 mo-docman-override_filename

 

Next upload this file

ftp_file_path_docman_upload

Last modified on วันอังคารที่ 24 พฤษภาคม 2011 เวลา 22:13 น.
Login to post comments

Search

who is online?

เรามี 1 บุคคลทั่วไป ออนไลน์

รับทำเว็บ, รับทำเว็บไซด์, ออกแบบเว็บ, รับทำ web, การ พัฒนา web application, ออกแบบ web, พัฒนาเว็บ, รับทำเว็บ ออกแบบเว็บ, เว็บ design, บริการออกแบบเว็บ, เขียน web application, ทำเว็บ, เว็บสำเร็จรูป, สร้างเว็บ, การสร้างเว็บ, เว็บฟรี, การทำเว็บ, เขียนเว็บ, รับทำเว็บ, ออกแบบเว็บ, สอนทำเว็บ, โปรโมทเว็บ, โปรแกรมสร้างเว็บ, การเขียนเว็บ, เว็บโฮสติ้ง, วิธีสร้างเว็บ, โปรแกรมทำเว็บ

(\__/)
(>`o`<)
(l)_,_(l)


\\\ ///
( @ @ )
....o00o.(_).o00o...