hi, everyone!

I need to upload several files .

I get the array of the uploaded files with:

$files = $sf_request->getFileName('works');

then I loop the array and save the uploaded files.
everything is ok,but I have trouble with validation.
I wrote the Validation File like : 
http://trac.symfony-project.com/trac/browser/doc/trunk/cookb
ook/upload.txt


methods:
  post:         [works]

names:
  works:
    required:         Yes
    validators:       myFileValidator
    file:             true

myFileValidator:
  class:              sfFileValidator
  param:
    mime_types:
      - 'image/jpeg'
      - 'image/png'
      - 'image/x-png'
      - 'image/pjpeg'
    mime_types_error:   Only PNG and JPEG files allowed!
    max_size:           5120000000
    max_size_error:     The Max size is 512000kb


It doesn't work, whatever(.zip, .rar, .doc ... and the each file
surely is smaller than max_size) I upload, I alway get a
max_size_error, I can't figure out what is the problem

Maybe it is the problem with the array but not a single field? then
how to tackle it?
I have googled the net, but none of them upload multi-files with
symfony..:(`
(Sorry for my English..)


<?php echo form_tag('works/upload', 'multipart=true');?>
  <?php
    for( $i = 0; $i < 5; ++$i)
    {
      echo input_file_tag("works[]") . '<br />';
    }
  ?>

<?php echo submit_tag('Upload!');?>



yours, grayblur


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to