File upload if empty replace nofile

Invidia 05 Jun, 2011
Hello,

Is it possible when the upload field is empty. The data in the database is saved to empty.jpg in place of NOFILE.

Thanks
GreyHead 06 Jun, 2011
Hi Invidia,

Which versaion of ChronoForms are you using?

I don't remember either version using NOFILE?

You can probably add custom code to replace a blank entry with a string.

Bob
Invidia 06 Jun, 2011
I'm using version 3.2. I'am not familiar with code.
GreyHead 06 Jun, 2011
Hi Invidia,

If your file input has the name 'file_0' then this code should work in the OnSubmit Before Email box I think:
<?php
$file = JRequest::getString('file_0', 'empty.jpg', 'post');
JRequest::setVar('file_0', $file);
?>

Bob

PS You must have 'Send Emails' set to 'Yes' on the form General tab for code in this box to run.
This topic is locked and no more replies can be posted.