Hallo @all
i have a small (maybe ;-)) Problem:
I want to save the data from the image resizer in the database, because I need this data later. Only I have at the moment no plan who :-(
Can you help me please ?
here is the debugger print:
file1 is the variable from Image upload.
i have a small (maybe ;-)) Problem:
I want to save the data from the image resizer in the database, because I need this data later. Only I have at the moment no plan who :-(
Can you help me please ?
here is the debugger print:
Array
(
[file1] => Array
(
[name] => 20151124145812_20151021093447_team3.jpg
[original_name] => 20151021093447_team3.jpg
[path] => images/uploadfiles/20151124145812_20151021093447_team3.jpg
[size] => 22632
[link] => images/uploadfiles/20151124145812_20151021093447_team3.jpg
[thumb_big] => 20151124145812_20151021093447_team3_big.jpg
[thumb_med] => 20151124145812_20151021093447_team3_med.jpg
[thumb_small] => 20151124145812_20151021093447_team3_small.jpg
)
)
file1 is the variable from Image upload.
Hi fibernet,
What exactly do you want to save and in what format?
The simplest solution is to add a Custom Code action with code like this
Bob
What exactly do you want to save and in what format?
The simplest solution is to add a Custom Code action with code like this
<?php
$form->data['file_data'] = json_encode($form->files);
?>
Then add a file_data column to your table (click Delete Cache in the Forms Manager toolbar after changing the table).
Bob
Hi Bob,
thx for the fastest answer. I want only store the values in the database, not the files itself.....e.g.
id......current id
user_id......current user id
thumb_small.......filename for small thumb
etc.
thx for the fastest answer. I want only store the values in the database, not the files itself.....e.g.
id......current id
user_id......current user id
thumb_small.......filename for small thumb
etc.
Hi fibernet,
My code doesn't save the files, just the file data, To save thumb_small you'd need a column called thumb_small and code like this
Bob
My code doesn't save the files, just the file data, To save thumb_small you'd need a column called thumb_small and code like this
<?php
$form->data['thumb_small'] = $form->files['file1']['thumb_small']'
?>
or you could get all the data for this file with <?php
foreach ( $form->files['file1'] as $k => $v ) {
$form->data[$k] = $v;
}
?>
Bob
This topic is locked and no more replies can be posted.