silly question, but did you check the permissions of the dir you're
writing it to?
-d
On Nov 20, 2007, at 7:53 AM, lionslair wrote:
>
> calling getFiles instead of getFileNames results in this from a
> var_dump() output.
>
> array(1) {
> ["newFile"]=>
> array(5) {
> ["name"]=>
> array(5) {
> [0]=>
> string(12) "IMGP0023.JPG"
> [1]=>
> string(12) "IMGP0029.JPG"
> [2]=>
> string(0) ""
> [3]=>
> string(0) ""
> [4]=>
> string(0) ""
> }
> ["type"]=>
> array(5) {
> [0]=>
> string(10) "image/jpeg"
> [1]=>
> string(10) "image/jpeg"
> [2]=>
> string(0) ""
> [3]=>
> string(0) ""
> [4]=>
> string(0) ""
> }
> ["tmp_name"]=>
> array(5) {
> [0]=>
> string(14) "/tmp/phpjKcvSj"
> [1]=>
> string(14) "/tmp/phpD8tyD8"
> [2]=>
> string(0) ""
> [3]=>
> string(0) ""
> [4]=>
> string(0) ""
> }
> ["error"]=>
> array(5) {
> [0]=>
> int(0)
> [1]=>
> int(0)
> [2]=>
> int(4)
> [3]=>
> int(4)
> [4]=>
> int(4)
> }
> ["size"]=>
> array(5) {
> [0]=>
> int(2324898)
> [1]=>
> int(2319065)
> [2]=>
> int(0)
> [3]=>
> int(0)
> [4]=>
> int(0)
> }
> }
> }
>
> On Nov 20, 7:54 pm, "Carsten Schumann"
> <[EMAIL PROTECTED]> wrote:
>> Okay, the next step is to trace down where your upload action
>> rejects the files.
>>
>> Your code looks ok since you copied most of the code from the
>> documentation.
>>
>> I would put some debugging messages into the code, i.e. var_dump's.
>> Before testing you should place an exit; before the redirect to avoid
>> redirecting which will discard your debugging output.
>>
>> Look which operations are successful and trace down the problem.
>>
>> Carsten
>>
>> PS: If you end up with the moveFile line you should check if you
>> enabled safe mode in php and if there is a file/permssion problem.
>>
>> On Nov 20, 2007 11:28 AM, lionslair <[EMAIL PROTECTED]>
>> wrote:
>>
>>
>>
>>> I can confirm that the files are being uploaded as per the globals
>>> data of the debug toolbar. See below.
>>
>>> files:
>>> newFile:
>>> name:
>>> - IMGP0008.JPG
>>> - IMGP0012.JPG
>>> - IMGP0023.JPG
>>> -
>>> -
>>> type:
>>> - image/jpeg
>>> - image/jpeg
>>> - image/jpeg
>>> -
>>> -
>>> tmp_name:
>>> - /tmp/phpfUF14o
>>> - /tmp/phpx28E56
>>> - /tmp/php1Lgh5g
>>> -
>>> -
>>> error:
>>> - 0
>>> - 0
>>> - 0
>>> - 4
>>> - 4
>>> size:
>>> - 2161103
>>> - 2389461
>>> - 2324898
>>> - 0
>>> - 0
>>> get:
>>> post:
>>> album_parent_id: 3
>>> commit: Upload file
>>> user_id: 2
>>
>>> This leads me to belive the files do exist but then are not being
>>> accessed by Symfony or I am trying to access them incorrectly.
>>
>>> On Nov 20, 7:11 pm, "Carsten Schumann"
>>> <[EMAIL PROTECTED]> wrote:
>>>> Hi!
>>
>>>> Did you check the upload file limit in your php.ini? Most of the
>>>> upload issues we had in the past were related to this limit.
>>
>>>> If it is fine, please check if php is aware of the uploaded
>>>> files. You
>>>> can do it by writing var_dump($_FILES) in your action.
>>
>>>> Carsten
>>
>>>> On Nov 20, 2007 10:54 AM, lionslair <[EMAIL PROTECTED]>
>>>> wrote:
>>
>>>>> Note: I have posted the on the forum but not really received a
>>>>> lot of
>>>>> help or a solution to this yet.
>>
>>>>> Can someone Please help me with this. I have been trying to work
>>>>> this
>>>>> out for hours with no success.
>>
>>>>> I tried uploading a single file and that worked fine. However
>>>>> when I
>>>>> then try and upload multiple files then the result is nothing. No
>>>>> error and no file upload.
>>
>>>>> See my view that makes the form.
>>
>>>>> <?php echo form_tag('@upload_photo', 'multipart=true') ?>
>>
>>>>> <?php echo input_hidden_tag('user_id', $sf_user->getProfile()-
>>>>>> getUserId()); ?>
>>
>>>>> <fieldset>
>>>>> <legend>Upload Photos</legend>
>>
>>>>> <div class="form-row">
>>>>> <?php echo label_for('album_parent_id', 'Parent Album') ?>
>>>>> <?php echo select_tag('album_parent_id',options_for_select(
>>>>> GalleryAlbumTools::nested_dropdown_albums($sf_user-
>>>>> >getProfile()-
>>>>>> getUserId()),
>>>>> $sf_params->get('album_parent_id'),
>>>>> 'include_blank=true'
>>>>> )) ?>
>>>>> </div>
>>>>> <?php for($i=1; $i <= 5; $i++): ?>
>>>>> <div class="form-row">
>>>>> <?php echo label_for('newFile', 'File:') ?>
>>>>> <?php echo input_file_tag('newFile[]') ?>
>>>>> </div>
>>>>> <?php endfor; ?>
>>
>>>>> <div>
>>>>> <?php echo submit_tag('Upload file') ?>
>>>>> </div>
>>
>>>>> </fieldset>
>>>>> </form>
>>
>>>>> And the resulting action
>>
>>>>> /**
>>>>> * Execute Action Upload photo
>>>>> *
>>>>> */
>>>>> public function executeUpload()
>>>>> {
>>>>> if ($this->getRequest()->getMethod() != sfRequest::POST)
>>>>> {
>>
>>>>> return sfView::SUCCESS;
>>>>> }
>>>>> else
>>>>> {
>>>>> if ($this->getRequest()->hasFiles())
>>>>> {
>>
>>>>> foreach ($this->getRequest()->getFileNames() as $fileName)
>>>>> {
>>>>> //$this->logMessage(' uploaded image: '.
>>>>> print_r($fileName),'err');
>>>>> $fileSize = $this->getRequest()->getFileSize($fileName);
>>>>> $fileType = $this->getRequest()->getFileType($fileName);
>>>>> $fileError = $this->getRequest()-
>>>>> >hasFileError($fileName);
>>>>> $fileRealName = $this->getRequest()-
>>>>> >getFileName($fileName);
>>>>> $uploadDir =
>>>>> sfConfig
>>>>> ::get
>>>>> ('sf_upload_dir').sfConfig::get('app_gallery_picture_folder').
>>>>> DIRECTORY_SEPARATOR . $fileName;
>>>>> //$uploadDir = sfConfig::get('sf_upload_dir');
>>
>>>>> $this->getRequest()->moveFile($fileName, $uploadDir);
>>>>> } // end foreach
>>
>>>>> $this->setFlash('class', 'confirmation');
>>>>> $this->setFlash('msg', 'Your images have been successfully
>>>>> uploaded');
>>>>> $this->redirect('@photo_management');
>>>>> } // end if file uplaods
>>
>>>>> } // end if else
>>
>>>>> } // end function executeUpload
>>
>>>>> What is it I am doing wrong?
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---