write image from variable to field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sticcino
User
Posts: 1043

write image from variable to field

Post by sticcino »

looking for suggestions or how to "stuff" the image path with a image file that was saved from getting a signature (using signature pad)

next to "select signature' button (which isn't really needed for this task), there is a button to popup a window to capture the users signature. using the signature_pad library located at github.. I've got the signature captured to a session variable and also have the filename that was created, which is saved on the server as guuid.png

is there any way to have the signature upload field point to that "./tmp/guuid.png" as its input ?

i'm look at manipulating the path the Row_Updating / Row_Inserting events, but not much success.

ex code:
$this->assessor_sig_file_id->Upload->FileName = ./library/tmp/11207ce8-f565-4516-951b-6961bd3068d0.png"

or am I too late at this stage to change the upload object.

I guess I could always just move it to the correct folder and update $rsnew['assessor_sig_file_id'] to the filename.


arbei
User
Posts: 9384

Post by arbei »

If the image is already uploaded by other library, you don't need to set the field as file upload field, you can try to use the HIDDEN Edit Tag. In Row_Updating and Row_Inserting events, you can just set the field's file name, e.g.

$rsnew["assessor_sig_file_id"] = "11207ce8-f565-4516-951b-6961bd3068d0.png";

Note: You also need to write some code (e.g. setting ViewValue or using Custom View Tag) to display the field properly.


shahparzsoft
User
Posts: 361

Post by shahparzsoft »

@ sticcino

can u please share ur script to save ur signature pad into session variable.

Thanks in advance .


Post Reply