Additional Processing Field - Resize uploaded image

Last updated on
30 April 2025

This additional processing snippet makes it possible to resize an image uploaded through a Webform file component. This assumes you've created a file component with the form key "file_upload" and resizes the image to be no bigger than 200 by 200 pixels.

$form_key = 'file_upload';
$file = unserialize($form_values['submitted_tree'][$form_key]);
image_scale($file['filepath'], $file['filepath'], 200, 200);

Help improve this page

Page status: Not set

You can: