Drupal 7 – Handling file uploads – allowed file extensions

While working with custom forms with file upload fields in drupal, you may sometimes get a error regarding extensions:

The specified file “your file name here” could not be uploaded. Only files with the following extensions are allowed: “jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp”

To allow all extensions, you have to manually set the ‘file_validate_extensions’ validator to an empty array.


Drupal – Force Path Prefix for Default Language

When you have more than one language on Drupal site, you have to define the default language among one of them. For example, if i set English as the default language, it will be shown in both http://<domain_name> and http://<domain_name>/en. but all the links in the default language will not have the en path prefix.

Build SuDoKu game using ReactJs

Build SuDoKu game using ReactJs

I recently thought of creating a SuDoKu game using JavaScript. Having played the classic game and enjoyed it in the past, I did not think of how complex the process of generating an instance of a game would be in the beginning. I quickly realized even after generating the random completed state successfully, creating a […]

DIY Auto sleep feature for a Cheap Multimeter (without a microcontroller)

DIY Auto sleep feature for a Cheap Multimeter (without a microcontroller)

This is a DIY project to make your cheap Multimeter which you forget to turn off and the next time you try to use it and the battery is fully drained. That happened to me a lot. This circuit can be used on any low-power device, not just a multimeter.

Writing data files to flash memory of ESP32

Writing data files to flash memory of ESP32

There are several reasons why you would want to write some data files to an ESP32 or similar MCU’s flash memory. In most of the projects, we need to work with configurations that we don’t want to hard code in our code. One of the most common use cases with ESP32 or similar MCUs is […]

© 2023 Anil Maharjan