Changeset 5013 for branches/2.0/include


Ignore:
Timestamp:
Mar 1, 2010, 5:20:24 PM (15 years ago)
Author:
plg
Message:

feature 1448 added: ability to set the upload directory (for pwg.images.add
API method).

Warning: due to risk on img src construction, the upload_dir must be relative
to the Piwigo directory itself.

Location:
branches/2.0/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/include/config_default.inc.php

    r4953 r5013  
    742742// or other plugin variables etc
    743743$conf['local_data_dir'] = dirname(dirname(__FILE__)).'/_data';
     744
     745// where should the API add photos?
     746$conf['upload_dir'] = PHPWG_ROOT_PATH.'upload';
    744747?>
  • branches/2.0/include/ws_functions.inc.php

    r4953 r5013  
    912912function ws_images_add_chunk($params, &$service)
    913913{
     914  global $conf;
     915 
    914916  ws_logfile('[ws_images_add_chunk] welcome');
    915917  // data
     
    942944  }
    943945
    944   $upload_dir = PHPWG_ROOT_PATH.'upload/buffer';
     946  $upload_dir = $conf['upload_dir'].'/buffer';
    945947
    946948  // create the upload directory tree if not exists
     
    991993function merge_chunks($output_filepath, $original_sum, $type)
    992994{
     995  global $conf;
     996 
    993997  ws_logfile('[merge_chunks] input parameter $output_filepath : '.$output_filepath);
    994998
     
    10041008  }
    10051009
    1006   $upload_dir = PHPWG_ROOT_PATH.'upload/buffer';
     1010  $upload_dir = $conf['upload_dir'].'/buffer';
    10071011  $pattern = '/'.$original_sum.'-'.$type.'/';
    10081012  $chunks = array();
     
    12311235  // upload directory hierarchy
    12321236  $upload_dir = sprintf(
    1233     PHPWG_ROOT_PATH.'upload/%s/%s/%s',
     1237    $conf['upload_dir'].'/%s/%s/%s',
    12341238    $year,
    12351239    $month,
Note: See TracChangeset for help on using the changeset viewer.