This topic is locked

Combining The Two Ways of Storing a File

1/21/2021 2:14:35 AM
PHPRunner General questions
F
fahad225 authorDevClub member

Hello Everyone,
I am working a project that needs a profile photo to be saved for student's record.

in PHPRunner I have two options of storing photos/files (1)Storing photos/files in the table as a binary format (2)Storing photos/files in a separate folder.
My question is: is there a way I can combine both of the two ways at the same time?

I am saying a one student's photo can be stored in a folder and also in another table at one time during adding record process. also editing is needed.
I need your help guys.
Database: MSSQL Database
Regards,

Sergey Kornilov admin 1/21/2021

It is possible with the help of code in events like BeforeAdd and BeforeEdit. PHPRunner will let you upload the file to the file system for instance and you can use your own code to save it to the database field additionally. And the same applies to editing.

F
fahad225 authorDevClub member 1/22/2021



It is possible with the help of code in events like BeforeAdd and BeforeEdit. PHPRunner will let you upload the file to the file system for instance and you can use your own code to save it to the database field additionally. And the same applies to editing.


Thanks Admin for the reply. Any link or sample code for custom file uploading to the file system, would be appreciated.

S
salus1DevClub member 1/23/2021

If you upload the images to a folder on your server you then could reference the images by URL using a different field.