File upload with form in a external php

mattiadj 20 Dec, 2011
Hello to all,
i have a problem with file upload.
For my easy managment i use to load the form code from an external php file and i use the code
<?php 
$path = JPATH_SITE;
require $path.'/form/preventivo/preventivo.php';?>


to load it and all is ok but when i try to upload a file with the upload file field nothing happens!
The problem is present ONLY if i load the code from external page, all is fine if i put the code into the code box on CF admin pannel but for me it necessary to have all files external.

The debug says me


Array
(
    [input_file_0] => cf.png
    [2f43a263f7eccd2d3c65572c09b0bb08] => 1
    [option] => com_chronoforms
    [chronoform] => prova
    [event] => submit
    [Itemid] => 
    [_PLUGINS_] => Array
        (
            [upload_files] => Array
                (
                )

        )

)


Also i have tried with

<?php 
include(JPATH_SITE.DS.'form'.DS.'preventivo'.DS.'prova.php');

?>


to include the file but is the same!

Help..
GreyHead 20 Dec, 2011
Hi mattiadj ,

Please put enctype="multipart/form-data" into the Form Tag Attachment box on the Form General tab. If you include the Form HTML ChronoForms can't detect that this is needed.

Bob
mattiadj 07 Feb, 2013
Thank you bob but i have tried and not working with latest version.
I have to insert the code with upload input type into the code area in form configuration. I can't use external file.
GreyHead 07 Feb, 2013
Hi mattiadj,

That was over a year ago :-(

I don't understand exactly what the problem is here. I include files all the time into ChronoForms, I don't see why a file input should cause any extra problems apart from the one I posted about earlier.

Bob
mattiadj 08 Feb, 2013
Hi Bob,
i know that is and old thread but the problem persist.
I have to add input file code directly in HTML code.
For my easy managment i use to load external file with all form code and put in HTML code only

<?php
$path = JPATH_SITE;
require $path.'/form/xxx/xxxx.php';?>

But i add to form code in external php file, input type of or captha code, these not work.

Any help??
GreyHead 08 Feb, 2013
Hi mattiadj ,

I'm sorry but I still don't know exactly what the problem is. I use included files in ChronoForms all the time with very few problems. You do have to make sure that you are including the right code in the right location though.

Bob
This topic is locked and no more replies can be posted.