Meta types for admin_input_upload_tag with stable 0.6.3 [message #14147]
Thu, 19 October 2006 06:04
goslund Messages: 5 Registered: September 2006 Location: Colorado
Junior Member
Hi-
in my situation i have used the admin generator to generate a backend for all of the site administration things that I need in my site- I only have run into one problem so far:
I can't upload mp3s with the basic setup. I copied the code I used in my pictures area generator.yml file (which works fine with picture types).
Do I need a partial or do I need to define what meta types the admin section will accept?
goslund Messages: 5 Registered: September 2006 Location: Colorado
Junior Member
ok wrote a custom validator for it and everything's working for the most part -- it won't let me upload non-mp3s.
However now when the file is uploaded through the backend.php stuff, it saves the file as a .bin file and not as a .mp3 file.. any tips?
It seems to me that firefox is causing the trouble.
More information: Have a look at sfWebRequest.class.php. There is the function getFileExtension($name), which should have a look at the mime type and find the correct file extension...
You could replace this methode by the following code, it works for me: