To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 4487

Show
Ignore:
Timestamp:
01/20/12 14:25:41 (4 months ago)
Author:
tboutell
Message:

The getFileName() method, to be useful, should return a full path to where the file was actually stored after making the name safe and so forth. This is a change, I'll talk to Wes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheHTML5Plugin/trunk/lib/uploader/qqFileUploader.class.php

    r4485 r4487  
    6969    private $sizeLimit = 10485760; 
    7070    private $file; 
     71    private $acceptedFilename; 
    7172 
    7273    function __construct(array $allowedExtensions = array(), $sizeLimit = 10485760){         
     
    150151        } 
    151152         
    152         if ($this->file->save($uploadDirectory . $filename . '.' . $ext)){ 
     153        $acceptedFilename = $uploadDirectory . $filename . '.' . $ext; 
     154        if ($this->file->save($acceptedFilename)) { 
     155            error_log("accepted"); 
     156            $this->acceptedFilename = $acceptedFilename; 
    153157            return array('success' => true); 
    154158        } else { 
     
    156160                'The upload was cancelled, or server error encountered'); 
    157161        } 
    158          
    159162    } 
    160163 
    161164    /** 
    162      * Returns name of handled file. 
     165     * Returns full path to handled file. 
    163166     * 
    164      * False if no file exists. 
     167     * False if no file has been successfully handled. 
    165168     * 
    166169     * 
     
    169172    public function getFileName() 
    170173    { 
    171       if (!$this->file) 
     174      error_log("Getting filename"); 
     175      if (!isset($this->acceptedFilename)) 
    172176      { 
    173177        return false; 
    174178      } 
     179      error_log("Returning {$this->acceptedFilename}"); 
    175180 
    176       return $this->file->getName(); 
     181      return $this->acceptedFilename; 
    177182    } 
    178183}