You might want to check exactly the mimetype that your browser is 
sending in through the request. Use these to make the list of acceptable 
mimes


[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm new here so my questions may be "simple" to answer but I can't
> solve these problemy by myselve:
>
> 1. File upload.
> I am trying to upload mp3s, my template looks like this:
> <?php echo form_error('song'); ?><?php echo input_file_tag('song') ?>
> and my validation file:
> fields:
>   song:
>     file:       true
>     required:
>       msg:      No song
>     sfFileValidator:
>       mime_types:
>         - 'audio/x-wav'
>         - 'audio/mpeg'
>       mime_types_error: Only MP3 und WAV
>       max_size:         1048576
>       max_size_error:   Max 1MB (1024kB)
>
> and every time I try to upload a file I get "No song" error, no matter
> if it's mp3 or wav...
>
> 2. Form validation.
> How can I validate such a form:
> <?php echo form_error('content'); ?>
> <?php echo object_textarea_tag($news, 'getContent', 'rich=true
> size=40x10 tinymce_options=theme:"simple"'); ?>
> my validation file looks like this:
> fields:
>   content:
>     required:
>       msg:       Err empty
>     sfStringValidator:
>       min:       10
>       min_error: Err too short
>       max:       2000
>       max_error: Err too long
>
> but it doesn't work (I cann still add empty news).
>
> 3. Form validation 2
> if I want to update data in for example my profile I got forms like
> these:
> <?php echo form_error('name'); ?>
> <?php echo input_tag('name', $user->getName(), 'maxlength=50'); ?>
> now I want to validate the input, so I made a editprofile.yml file
> with all stuff I need to check but now, when the validation fails I
> get errors like:
> Notice: Undefined variable: user in...
> and
> Fatal error: Call to a member function getName() on a non-object in...
> is the template being opened after the validation fails without
> executing the actions? How can I fix this?
>
> I will be grateful for any help. I have already posted the second and
> third in the forum but didn't get any help (yet).
>
> Thanks.
>
> C
>
>
> >
>   


-- 
Haris Zukanović
CEO
Software development and research
International Business Development, SOFTING ltd.
 

office  +387 36 318 339
GSM     +387 61 839 069
 
http://www.eu-softing.com




 
CONFIDENTIALITY NOTICE
------------------------------------------------------------------------------------------------------------------------
This e-mail and any attached files, sent by a company e - mail system, contains 
company confidential and/or privileged information and is intended only for the 
person or entity to which it is addressed and only for the purposes therein set 
forth. If you are not the intended recipient (or have received this e-mail in 
error) please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure, distribution or other use of, or taking of 
any action in reliance upon, the material in this e-mail by persons or entities 
other than the intended recipient is strictly forbidden.
-------------------------------------------------------------------------------------


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

begin:vcard
fn;quoted-printable:Haris Zukanovi=C4=87
n;quoted-printable:Zukanovi=C4=87;Haris
org:Softing d.o.o Mostar;Software development and research
adr:;;K.M.V.H 12;Mostar;HNK;88000;Bosnia and Herzegovina
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+387 36 318 339
tel;fax:+387 36 318 339
tel;pager:N/A
tel;home:N/A
tel;cell:+387 61 839 069
url:http://www.eu-softing.com
version:2.1
end:vcard

Reply via email to