Empty file called doc.svg appears when trying to set the value of an upload field

By: Enrico Brugnoni | Asked: 07/24/2023
ForumsCategory: General questionsEmpty file called doc.svg appears when trying to set the value of an upload field
Enrico Brugnoni asked 1 year ago

Exactly what the title says, i am trying to set an upload field to a certain file.
For the purpose of what i am doing, the file is being uploaded into another form, then i get the value (file) via php code and set it as the new value of that field.i tried even using metadata, in both cases, the value(file) is actually there, there are no permission issues, as, when i try to print it fron end, it works flawlessly and i can even get to it via url.

I use this code to get the value(file) that i need:
$field_value_171 = FrmProEntriesController::get_field_value_shortcode($args_171);

and, as i said before, if i echo this i can print it withou any issues.then i set the value fo the field i want with this code:
if ($field->id == 145 && !empty($file_id_169)) {
$values[\'value\'] = $file_id_169; }

However, instead of the correct file, an empty file (see attachment) appears.What is the issue? It\'s surely something with formidable and the format of the information i am giving it to set as value for the field, but how? What informations should i give it?

Attachments

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right