Changeset 6052


Ignore:
Timestamp:
May 3, 2010, 2:49:26 PM (14 years ago)
Author:
plg
Message:

bug 1639 fixed: the upload form now correctly uses the $confupload_dir
parameter (web API already use it).

By default, the $confupload_dir is no longer dependent to PHPWG_ROOT_PATH
because it becomes a real mess when admin/include/uploadify.php (called
directly, not from an include) tries to perform an upload.

Improvement: make clearer how $confupload_dir can be set (relative to the
Piwigo installation directory + HTTP reachable)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upload.inc.php

    r5957 r6052  
    3232  // upload directory hierarchy
    3333  $upload_dir = sprintf(
    34     PHPWG_ROOT_PATH.'upload/%s/%s/%s',
     34    PHPWG_ROOT_PATH.$conf['upload_dir'].'/%s/%s/%s',
    3535    $year,
    3636    $month,
     
    9797    'date_available' => $dbnow,
    9898    'tn_ext' => 'jpg',
    99     'path' => preg_replace('/^.*?upload/', './upload', $file_path),
     99    'path' => preg_replace('#^'.preg_quote(PHPWG_ROOT_PATH).'#', '', $file_path),
    100100    'filesize' => $file_infos['filesize'],
    101101    'width' => $file_infos['width'],
  • trunk/admin/photos_add_direct.php

    r6051 r6052  
    120120      if ('zip' == strtolower($extension))
    121121      {
    122         $upload_dir = PHPWG_ROOT_PATH.'upload/buffer';
     122        $upload_dir = $conf['upload_dir'].'/buffer';
    123123        prepare_directory($upload_dir);
    124124       
  • trunk/include/config_default.inc.php

    r5470 r6052  
    762762$conf['local_data_dir'] = dirname(dirname(__FILE__)).'/_data';
    763763
    764 // where should the API add photos?
    765 $conf['upload_dir'] = PHPWG_ROOT_PATH.'upload';
     764// where should the API/UploadForm add photos? This path must be relative to
     765// the Piwigo installation directory (but can be outside, as long as it's
     766// reachable from your webserver).
     767$conf['upload_dir'] = './upload';
    766768
    767769// where should the user be guided when there is no photo in his gallery yet?
Note: See TracChangeset for help on using the changeset viewer.