Proyectos de Subversion LeadersLinked - Services

Rev

Rev 809 | Rev 811 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 809 Rev 810
Línea 125... Línea 125...
125
            $storageFileMapper = \LeadersLinked\Mapper\StorageFileMapper::getInstance($this->adapter);
125
            $storageFileMapper = \LeadersLinked\Mapper\StorageFileMapper::getInstance($this->adapter);
126
            $storageFile = $storageFileMapper->fetchOneByCode($code);
126
            $storageFile = $storageFileMapper->fetchOneByCode($code);
Línea 127... Línea 127...
127
            
127
            
128
            $storageDir = $this->config['leaderslinked.storage.path'];
128
            $storageDir = $this->config['leaderslinked.storage.path'];
-
 
129
            $storageFileFullPath = $storageDir . DIRECTORY_SEPARATOR . $storageFile->path;
-
 
130
 
Línea 129... Línea 131...
129
            $storageFileFullPath = $storageDir . DIRECTORY_SEPARATOR . $storageFile->path;
131
            $this->logger->err('storageFileFullPath = ' . $storageFileFullPath);
Línea 130... Línea 132...
130
            
132
            
Línea 151... Línea 153...
151
                    $mimeType = mime_content_type($storageFileFullPath);
153
                    $mimeType = mime_content_type($storageFileFullPath);
152
                    if($mimeType===false) {
154
                    if($mimeType===false) {
153
                        $mimeType = 'application/octet-stream';
155
                        $mimeType = 'application/octet-stream';
154
                    }
156
                    }
Línea 155... Línea 157...
155
                    
157
                    
Línea 156... Línea 158...
156
                    $fileContent = file_get_contents($storageFileFullPath);
158
                    $fileContent = file_get_contents($storageFile->path);
157
                    
159
                    
158
                    $response = $this->getResponse();
160
                    $response = $this->getResponse();
159
                    $headers = $response->getHeaders();
161
                    $headers = $response->getHeaders();
Línea 170... Línea 172...
170
                } else {
172
                } else {
171
                    return $this->getResponse()->setStatusCode(404);
173
                    return $this->getResponse()->setStatusCode(404);
172
                }
174
                }
Línea 173... Línea 175...
173
      
175
      
174
            } else {
-
 
175
                $this->logger->err('StorageFile not found: ' . $storageFileFullPath);
176
            } else {
176
                return $this->getResponse()->setStatusCode(404);
177
                return $this->getResponse()->setStatusCode(404);
Línea 177... Línea 178...
177
            }
178
            }
178
        
179