files rename fix

This commit is contained in:
Ulf Gebhardt 2014-05-31 01:58:38 +02:00
parent b29e8e4947
commit 868f845102
3 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,2 @@
db
--

View File

@ -44,7 +44,8 @@ class files {
throw new \SYSTEM\LOG\ERROR("No matching Cat '" . $cat . "' found.");}
if(!file_exists(self::$folders[$cat].$id)){
return false;}
return rename(self::$folders[$cat].$id, self::$folders[$cat].$newid);
$ext = pathinfo(self::$folders[$cat].$id);
return rename(self::$folders[$cat].$id, self::$folders[$cat].$newid.'.'.$ext['extension']);
}
private static function getFolder($folder) {

View File

@ -39,7 +39,7 @@ function register_controlls(){
});
$('.btn_upload').click(function(){
var formData = new FormData($('#form_'+$(this).attr('cat'))[0]);
var formData = new FormData($('#form_'+$(this).attr('cat')));
$.ajax({
url: SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='+$(this).attr('cat'), //Server script to process data
type: 'POST',