You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context:
I have a custom module with some actions when a file is downloaded.
I need to know if the downloaded file is managed by cfile.
The way I do:
Get file guid from request parameters: $fileguid = Yii::$app->request->get('guid')
Then query in db 'file' table to get the file id
Then query in db cflies_file table and check if the id is in the table.
If the id is in the table it means that it's a "cfile" file.
Issue:
Some times it works, some times it doesn't.
This is because a lot of files that are referenced in folders are not in the "cfiles_file" table.
It seems that only "old" files are in the table but not new files.
When I browse in the folders, all files are present and download counter is updated. But I cannot find counter value of new files in db
So I worry about the way it works.
Questions
Please, how does it work?
From de file guid, is there a simple way to check is the file is a "cfile" file?
Thank you in advance for your comments
The text was updated successfully, but these errors were encountered:
Gilbertdelyon
changed the title
From fiel guid, how can I know if a file is a "cfile" file ?
From file guid, how can I know if a file is a "cfile" file ?
Feb 29, 2024
Context:
I have a custom module with some actions when a file is downloaded.
I need to know if the downloaded file is managed by cfile.
The way I do:
Get file
guid
from request parameters:$fileguid = Yii::$app->request->get('guid')
Then query in db
'file'
table to get the fileid
Then query in db
cflies_file
table and check if theid
is in the table.If the id is in the table it means that it's a "cfile" file.
Issue:
Some times it works, some times it doesn't.
This is because a lot of files that are referenced in folders are not in the "cfiles_file" table.
It seems that only "old" files are in the table but not new files.
When I browse in the folders, all files are present and download counter is updated. But I cannot find counter value of new files in db
So I worry about the way it works.
Questions
guid
, is there a simple way to check is the file is a "cfile" file?Thank you in advance for your comments
The text was updated successfully, but these errors were encountered: