Uppercase file extension saving as lowercase in database.
If I upload an image from my iPhone in my Fuel module, it has an uppercase extension (photo.JPG). It gets saved as photo.jpg in the database, but the file uploaded is still photo.JPG, so it doesn't display on the website. How can I make the extension lowercase? In form_fields, I have $filename = strtolower(uniqid()); and $fields['picture_upload'] = array('type' => 'file', 'upload_path' => $upload_path, 'filename' => $filename, 'overwrite' => TRUE);
Comments
Here are some general instructions for upgrading (it may vary though depending on your installation so be sure to save a copy if you need to revert back).
http://forum.getfuelcms.com/discussion/1515#Item_2
function on_after_post($values){ { $uploaded = $this->fuel->assets->uploaded_data(); $upload_path = $uploaded['image']['upload_path']; $new_name = preg_replace('#\.JPG$#', $upload_path); rename($upload_path, $new_name); $record = $this->find_by_key($values['id']); $record->image = strtolower($values['image']; $record->save(); }