Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony]sfThumbnailPlugin nie działa getFilePath
stirith
post
Post #1





Grupa: Zarejestrowani
Postów: 162
Pomógł: 2
Dołączył: 18.01.2008

Ostrzeżenie: (0%)
-----


W symfony 1.2 nie ma czegoś takiego jak "getFilePath"

No to jak mam pobrać ścieżkę do pliku dla:

Kod
  $thumbnail->loadFile();

cały kod:
Kod
    foreach ($this->getRequest()->getFiles('file') as $fileName) {

  // Create the thumbnail
  $thumbnail = new sfThumbnail(150, 150);
  $thumbnail->loadFile($this->getRequest()->getFilePath('file'));
  $thumbnail->save(sfConfig::get('sf_upload_dir').'/images/'.$fileName, 'image/jpg');

  // Move the uploaded file to the 'uploads' directory
  $this->getRequest()->moveFile('file', sfConfig::get('sf_upload_dir').'/'.$fileName);
}
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Gribo
post
Post #2





Grupa: Zarejestrowani
Postów: 237
Pomógł: 17
Dołączył: 1.11.2007
Skąd: Zielona Góra

Ostrzeżenie: (0%)
-----


Przypuszczam że chcesz zrobić upload zdjęcia więc możesz zrobić to w ten sposób :
  1. $thumbnail = new sfThumbnail(150, 150);
  2. $thumbnail->loadFile($file->getTempName());

mogę sie mylić bo piszę z głowy a dawno tego nie używałem.

aha jesli używasz sf 1.2 to zamiast $this->getRequest() polecam $request-> (IMG:style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 02:50