in relation,this seems not like a big deal (maybe cause i spent the
whole weekend figuring out ajax), but somehow i dont get it done. when
the user is selectig a file for an upload, i wanna make sure it's an
image.
so far i am checking in my controller
if (($this->data['User']['name']['type'] != 'image/jpeg') ||
($this->data['User']['name']['type'] != 'image/png') || ($this-
>data['User']['name']['type'] != 'image/gif')) {
$this->set('error','Du kannst nur Bilder hochladen(jpeg, png,
gif)');
$this->render('previewprofileimage','ajax');
} else {
process upload and resize
}
now what happens is, that even if the file is an image cake won't see
it. i guess sth with the or operator is messed up???
that's the form btw: the .ctp-file
<?php
echo $form->create('User',
array('name'=>'uploadProfileImageForm','id'=>'uploadProfileImageForm','type'=>'file'));
echo $form->file('User');
?>
<button
onClick="ajaxUpload(this.form,'editprofile','image_preview','<br /
><img src=\'../img/icons/loader.gif\' width=\'16\' height=\'16\'
border=\'0\' />','Error in upload'); return false;"
type="button">Hochladen</button>
<?php
echo $form->end();
?>
thx a lot :)
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment