Lars' Tech Tips

Small things that make your life easier

Skip to: Content | Sidebar | Footer



Configuring FileField allowed extensions in Drupal

8 April, 2010 (13:52) | Drupal, PHP | By: Lars

Problem: you try to upload a file in Drupal and you get something like this:

The selected file <file> cannot not be uploaded. Only files with the following extensions are allowed:…

for an extension that is included in Administer->File Uploads.

I found that I had the module CCK FileField installed and its allowed extensions are configured in a different place (that is very hard to find too):

Administer->Content Management->Content types.

For the File / Upload files entry click on “manage fields” under Operations the for the filed_file entry click Configure under Operations. You’ll find “Permitted upload file extensions:” there.

Hope it helps, it took me much too long to find it.

Change the date format in Symfony with Propel

2 March, 2010 (01:28) | PHP, Symfony / Propel | By: Lars

You’ll usually want to have the same date format all over your Symfony / Propel project.

You only need to change one thing to do that:

In config/propel.ini:

propel.defaultTimeStampFormat = j M Y H:i
propel.defaultTimeFormat      = H:i
propel.defaultDateFormat      = j M Y

You can set the above format using PHP date() formatting.

After setting this run Symfony tasks propel:build-all (you may not need to reload the sql though) and cache:clear.

That’s all, enjoy!