Changeset 147

Show
Ignore:
Timestamp:
01/19/06 23:45:47 (3 years ago)
Author:
ben
Message:

File uploads / downloads now work again (resolved assumptions about path in $file->location)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/_files/download.php

    r146 r147  
    3434                                        $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']); 
    3535                                         
    36                                         $tstamp = filemtime($file->location); 
     36                                        $tstamp = filemtime(path . $file->location); 
    3737                                        $lm = gmdate("D, d M Y H:i:s", $tstamp) . " GMT"; 
    3838                                         
     
    4848                                         
    4949                                        // Then output some appropriate headers and send the file data! 
    50                                         $mimetype = run("files:mimetype:determine",$file->location); 
     50                                        $mimetype = run("files:mimetype:determine",path . $file->location); 
    5151                                        if ($mimetype == false) { 
    5252                                                $mimetype = "application/octet-stream"; 
     
    6161                                                header('Content-Disposition: attachment'); 
    6262                                        } 
    63                                         readfile($file->location); 
     63                                        readfile(path . $file->location); 
    6464                                 
    6565                        } 
  • devel/_files/icon.php

    r45 r147  
    11<?php 
    22 
    3         // Download script 
    4         // Usage: http://URL/{username}/files/{folder_id}/{file_id}/{filename} 
     3        // Icon script 
    54         
    65        // Run includes 
     
    2928                                                $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']); 
    3029                                                 
    31                                                 $tstamp = filemtime($file->location); 
     30                                                $tstamp = filemtime(path . $file->location); 
    3231                                                $lm = gmdate("D, d M Y H:i:s", $tstamp) . " GMT"; 
    3332                                                 
     
    4948                                                } 
    5049                                                if ($mimetype == "image/jpeg" || $mimetype == "image/png") { 
    51                                                         $icon = url . "units/phpthumb/phpThumb.php?w=90&src=" . urlencode($file->location); 
     50                                                        $icon = url . "units/phpthumb/phpThumb.php?w=90&src=" . urlencode(path . $file->location); 
    5251                                                        $mimetype = "image/jpeg"; 
    5352                                                } else {