This topic is locked

Upload files to file directory from events code

12/10/2021 9:36:36 AM
PHPRunner General questions
J
jmfernandez author

Hello.
I have a process that generates a new record and one of the fields of that record is a file.

I would like to know if it is possible to add a file, for example a pdf generated in an event, directly from the event, without the user needing to upload the file.

The field type is text. The file is uploaded to a folder on the server.
This is an example of a file uploaded by the user:
[{"name":"files\/ecm_propuesta\/doc\/CRISTALERIA ROMERO_Presupuesto cristal comedor_2021_5r86hb6y.pdf","usrName":"CRISTALERIA ROMERO_Presupuesto cristal comedor_2021.pdf","size":73684,"type":"application\/pdf","searchStr":"CRISTALERIA ROMERO_Presupuesto cristal comedor_2021.pdf,!:sStrEnd"}]

It's possible?

Sergey Kornilov admin 12/10/2021

See How to create a PDF file and save it to the output folder article in the manual. All you need to do is to specify a different path so file_put_contents() function saves PDF file to the required folder.

fhumanes 12/10/2021

Hola,

Si las indicaciones que te ha pasado Sergey no te son suficientes, yo te puedo hacer un ejemplo que se ajuste a lo que necesitas.

Todas mis ayudas son gratis.

Díme si necesitas algo en mi email https://fhumanes.com/

Saludos,
fernando

fhumanes 12/12/2021

Hello,

As @jmfernandez I kept having any doubts I referred to this example: Convert MS Office to PDF Document
Which has that same functionality.

Greetings,
fernando