Hi!
I have a multiple files upload throught Chronoforms + ChronoConnectivy, and all is working perfect (from 1 to 5 files in total).
My question is regarding to DELETE one or more files through chronoforms.
From the database I think I won't have problems: I can add a checkbox and, when this is checked, put a text like "no file" on the database.
But I need to delete this file, physically, from my server.
How can the users delete 1 or more uploaded files from the server through Chronoforms?
I have a multiple files upload throught Chronoforms + ChronoConnectivy, and all is working perfect (from 1 to 5 files in total).
My question is regarding to DELETE one or more files through chronoforms.
From the database I think I won't have problems: I can add a checkbox and, when this is checked, put a text like "no file" on the database.
But I need to delete this file, physically, from my server.
How can the users delete 1 or more uploaded files from the server through Chronoforms?
Hello Kronosites,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I zip uploaded files?
How can I edit uploaded files in a form?
How can I attach uploaded files to an email?
How can I link to an uploaded file?
How can I delete old file uploads?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I zip uploaded files?
How can I edit uploaded files in a form?
How can I attach uploaded files to an email?
How can I link to an uploaded file?
How can I delete old file uploads?
P.S: I'm just an automated service😉
Hi Kronosites,
You'd need a custom code action with PHP something like this:
Biob
You'd need a custom code action with PHP something like this:
<?php
jimport('joomla.filesystem.file');
$path = JPATH_SITE.'/path_to/files/folder/';
$file = $form->data['file_name'];
if ( is_file($path.$file) ) {
JFile::delete($path.$file);
}
?>
!!! not tested and may need debugging !!!
Biob
Hi again,
I put the code in "On Submit" but it didn't work.
Here you are my code:
I put a debugger on Chronoforms and Chronoconnectivity but nothing is showed about it.
I put the code in "On Submit" but it didn't work.
Here you are my code:
<?php
jimport('joomla.filesystem.file');
$path = JPATH_SITE.'/components/com_chronoforms5/chronoforms/uploads/CCT-HerramientaECG1/';
$file = $form->data['delfile1'];
If ( is_file($path.$file) ) {
JFile::delete($path.$file);
}
?>
I put a debugger on Chronoforms and Chronoconnectivity but nothing is showed about it.
This topic is locked and no more replies can be posted.