Hi,
I have generated an admin backend.
Some fields are type of admin_input_file_tag.
It works fine. Except that the file name is changed.
For instance, uploading fake_article.pdf becomes
1e0d5f6621b2a5a05dffdbfcd787ed31.pdf
Is it possible to keep the original file name?
Thanks,
Julien
Hello Julien,
The file name is changed since he's encoded via sha1() function (
http://fr2.php.net/manual/en/function.sha1.php) by default.
I think it's not recommended to keep the original file name (name conflict,
security...), but you can customise the filename via the generator.yml :
I used Smarty for a long time because I found the templates much more
redable. But from my experience the PHP code generated by Smarty from
the templates is quite ugly. And since I discovered the PHP script
version ie if(): endif; I find PHP code in the template quite
readable.
You can go even
You'll have to override the admin-gen save method of your module or to make
your own admin generator theme.
++ COil
- Message d'origine
De : julien [EMAIL PROTECTED]
À : symfony users symfony-users@googlegroups.com
Envoyé le : Dimanche, 5 Octobre 2008, 13h31mn 26s
Objet :
Hi,
same opinion from my side. We use smarty in the office and we are
faced very often with smarty limitations which are very annoying.
Another thing is the lack of inheritance or customization
possibilities of smarty.
Try to add a custom handler for the compiling which does not use the
thanks for your answers.
I think I'll try to override the save, but I'm not quite sure how to
do it.
I've been in the source : /cache/my_app/dev/modules/automy_module/
actions/actions.class.php
It seems that two methods are actually used to save the form.
executeEdit() and
Absolutely.
- Message d'origine
De : julien [EMAIL PROTECTED]
À : symfony users symfony-users@googlegroups.com
Envoyé le : Dimanche, 5 Octobre 2008, 22h27mn 35s
Objet : [symfony-users] Re: Re : [symfony-users] Re: file name changed after
upload
thanks for your answers.
I think I'll