Browse Source

Correctifs images

idleman 7 years ago
parent
commit
fbf6865363
2 changed files with 7 additions and 1 deletions
  1. 6 1
      action.php
  2. 1 0
      install.php

+ 6 - 1
action.php

@@ -239,10 +239,15 @@ switch ($_['action']){
 			$name = $resource->id.'.'.$ext;
 			$path = SKETCH_PATH.$name;	
 			move_uploaded_file($_FILES['file']['tmp_name'], $path);
+			
 			$resource->content = $name;
 			$resource->save();
 			$response = array_merge(Type::get($resource->type));
-			$response['url'] = $path.'?v='.time();
+			//$response['url'] = $path.'?v='.time();
+			
+			$response['url'] ="action.php?action=get_resource_image&id=".$resource->id."&v=".time();
+			
+			
 		});
 	break;
 	

+ 1 - 0
install.php

@@ -63,6 +63,7 @@ try {
 	if(!extension_loaded('gd') || !function_exists('gd_info'))  throw new Exception('L\'extension php GD2  est requise, veuillez installer GD2 (sous linux : <code>sudo apt-get install php5-gd && service apache2 restart</code>)');
 	if(!in_array('sqlite',PDO::getAvailableDrivers())) throw new Exception('Le driver SQLITE est requis, veuillez installer sqlite3 (sous linux : <code>sudo apt-get install php5-sqlite && service apache2 restart</code>)');
 	
+	if (!file_exists(__ROOT__.PART_PATH)) mkdir(__ROOT__.PART_PATH,0755,true);
 	
 	//Class entities
 	Entity::install(__ROOT__.'class');