Forums

file upload not acquired-Chronoforms 4 RC3.3 & joomla 1.7.3

danielitob 19 Dec, 2012
Dear all,
i have a problem with file upload. I use Chronoforms 4.0 RC 3.3 and joomla 1.7.3.
I have a form with 2 field:

1) Text box (required)
2) Upload file (not required)àGhost(Enable ghost:true; Ghost value: {field name}

When I submit the form and compile only the text box field, I have a blank page and saving in the db doesn’t work correctly.
Instead, if I compile the text box field and attach a file, saving in the db work correctly.
I use also Debugger in Events, but however I have a blank page. These are my events:

OnSubmit
Auto Server Side Validation (40)
OnSuccess
Upload Files (41)
OnSuccess
DB Save (42)
Custom Code - (43)
Debugger (50)
ReDirect URL (44)
Redirect User (45)

I’ve seen others topic, such as http://www.chronoengine.com/forums.html?cont=posts&f=4&t=20989, but I don’t understand how I can solve the problem.

Could you help me?

Kindly regards
Daniele
GreyHead 19 Dec, 2012
Hi Daniele,

I suspect that the problem is that you have an entry in the Ghost Value box. If you don't upload a file the ChronoForms Upload Files action will see this entry and try to upload a file that doesn't exist.

Bob
danielitob 19 Dec, 2012
Dear Bob,
thanks very much for your quick reply.
Unfortunately I have already tried not to put any value in Ghost Value box, i also tried to de-check Enable Gost box, but nothing has changed.

Can you give me any other suggestions?

Thanks a lot.

Daniele
GreyHead 19 Dec, 2012
Hi Daniele,

So what does this mean "Ghost value: {field name}" - puzzled??

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
danielitob 19 Dec, 2012
Hi Bob,
i don't use Easy Wizard.
However, the file upload box have:
-Field Name = allegato
-Enable Ghost = true
-Ghost Value ={allegato}

Using Debugger Event, i have

Data Array:

Array
(
[option] => com_chronoforms
[chronoform] => inserimentoReferenza-Copy
[event] => submit
[Itemid] =>
[nome] => test
[allegato] => {allegato}
[inserisciReferenza] => Inserisci
[555539bb5bf3d590201fd422c940f89b] => 1
)

Validation Errors:

Array
(
)

If i remove {allegato} in Ghost Value, using debugger event i have:

Array
(
[option] => com_chronoforms
[chronoform] => inserimentoReferenza-Copy
[event] => submit
[Itemid] =>
[nome] => test
[allegato] =>
[inserisciReferenza] => Inserisci
[555539bb5bf3d590201fd422c940f89b] => 1
)

The upload file doens't attach any file in email, but it only save the filename in db.

Thanks very much Bob,
regards
GreyHead 19 Dec, 2012
Hi Daniele,

Please copy and paste **all** of the Debugger output here.

Bob
danielitob 19 Dec, 2012
Hi Bob,
as i wrote before, if i insert Debugger event in Upload Files event, i have always a blank page.
If i insert debugger in OnSubmit Event (before the Upload Files event), the output is:

Data Array:

Array
(
[option] => com_chronoforms
[chronoform] => inserimentoReferenza-Copy
[event] => submit
[Itemid] =>
[nome] => test
[allegato] =>
[inserisciReferenza] => Inserisci
[555539bb5bf3d590201fd422c940f89b] => 1
)

Validation Errors:

Array
(
)

If i set
Ghost Value ={allegato}, in the debugger i have
[allegato] => {allegato}.

Regards,
Daniele
danielitob 20 Dec, 2012
Hi Bob,
could you suggest me anything?
Thank you in advance.

Daniele
GreyHead 20 Dec, 2012
Hi Daniele,

Please, please, please do not put ***anything*** in the Ghost Value.

It looks to me as though your Upload Files action isn't enabled, or isn't correctly configured. What settings do you have in there.

Bob
danielitob 20 Dec, 2012
Hi Bob,
i have:
-Field Name = allegato
-Label Text = Carica Immagine
-Enable Ghost = true

and it doesn't work. I de-check also Enable Ghost and however it doesn't work.

Could be a problem of Joomla? i have 1.7.3 and i didn't upgrade to 1.7.5.

Regards,
daniele
GreyHead 20 Dec, 2012
Hi Daniele,

What settings do you have in the Upload Files action?? Or the Files Upload tab if you are using the Easy Wizard?

Bob
danielitob 20 Dec, 2012
In Upload Files i have:
-Enabled= Yes
-Files= allegato:png
-Max Size in KB = 2000
-Min Size in KB = 0
-Safe File name= yes

Regards,
Daniele
GreyHead 20 Dec, 2012
Hi Daniele,

That looks OK but I don't understand why it isn't showing in the Debugger output.

Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

Bob
GreyHead 21 Dec, 2012
Hi Daniele,

Your form appears to be working correctly here. I don't see any problems with it. I think that the only change I made was to move the Debugger to the end of the On Submit event so that you can see all of the output.
Data Array:

Array
(
    [option] => com_chronoforms
    [chronoform] => inserimentoReferenza-Copy
    [event] => submit
    [Itemid] => 
    [nome] => nome
    [descrizione] => descrizione
    [giorno] => 20
    [mese] => 12
    [anno] => 2012
    [allegato] => 20121221021635_test_image.png
    [inserisciReferenza] => Inserisci
    [8c338ab5840a3456e377eb66780fe0c5] => 1
    [_PLUGINS_] => Array
        (
            [upload_files] => Array
                (
                    [allegato] => Array
                        (
                            [name] => 20121221021635_test_image.png
                            [original_name] => test_image.png
                            [path] => /home/greyhead/greyhead.org/components/com_chronoforms/uploads/inserimentoReferenza-Copy/20121221021635_test_image.png
                            [size] => 3040
                            [link] => http://greyhead.org/components/com_chronoforms/uploads/inserimentoReferenza-Copy/20121221021635_test_image.png
                        )

                )

        )

    [chronoform_data] => Array
        (
            [cf_uid] => 0be99fc97e7fa4f672dab567992f1450
            [cf_created] => 2012-12-21 02:16:35
            [cf_created_by] => 0
            [cf_ipaddress] => 86.214.115.251
            [cf_user_id] => 0
            [option] => com_chronoforms
            [chronoform] => inserimentoReferenza-Copy
            [event] => submit
            [Itemid] => 
            [nome] => nome
            [descrizione] => descrizione
            [giorno] => 20
            [mese] => 12
            [anno] => 2012
            [allegato] => 20121221021635_test_image.png
            [inserisciReferenza] => Inserisci
            [8c338ab5840a3456e377eb66780fe0c5] => 1
            [_PLUGINS_] => Array
                (
                    [upload_files] => Array
                        (
                            [allegato] => Array
                                (
                                    [name] => 20121221021635_test_image.png
                                    [original_name] => test_image.png
                                    [path] => /home/greyhead/greyhead.org/components/com_chronoforms/uploads/inserimentoReferenza-Copy/20121221021635_test_image.png
                                    [size] => 3040
                                    [link] => http://greyhead.org/components/com_chronoforms/uploads/inserimentoReferenza-Copy/20121221021635_test_image.png
                                )

                        )

                )

            [cf_id] => 3
        )

    [chronoform_data_cf_id] => 3
    [redirect_url] => index.php?chronoform=visualizzaReferenze&option=com_chronoforms&p=ae1m2e4s3l
)

Validation Errors:

Array
(
)

Debug Data

    Upload routine started for file upload by : allegato
    /home/greyhead/greyhead.org/components/com_chronoforms/uploads/inserimentoReferenza-Copy/20121221021635_test_image.png has been uploaded successfully.
    redirect_url
        redirect_url_target_url: index.php?option=com_chronoforms&chronoform=visualizzaReferenze
        Redirect URL: index.php?chronoform=visualizzaReferenze&option=com_chronoforms&p=ae1m2e4s3l
    redirect_user
        redirect_user_target_url: index.php?option=com_chronoforms&chronoform=visualizzaReferenze
        Redirect URL (click to continue):
        index.php?chronoform=visualizzaReferenze&option=com_chronoforms&p=ae1m2e4s3l	

You can see that the database save is complete and the files have been uploaded.

Bob

PS In general I recommend that you don't use the On Success events to add other actions; instead put them after the previous action. The effect is the same but without the nesting the form is cleaner and the chances of problems are reduced.
danielitob 21 Dec, 2012
Dear Bob,
as i wrote in the first message, the form works successfully if i attach an image in file upload box.
The box it "not Acquired" and if i don't attach any file i have a blank page and the forms doesn't work.
Thank you in advance.
Regards,
Daniele
GreyHead 21 Dec, 2012
Hi Daniele,

I'm sorry I'd forgotten that was the original problem :-(

It's because you have put all your DB Save, etc. actions inside the Upload Files - On Success event. If there is no file to upload then this event isn't run. You need to move them back into the main On Submit event. I would structure your form events like this
Auto Server Side Validation
  OnSuccess
    // leave empty
  OnFail
    Custom Code
    Event Loop
Upload Files
  OnSuccess
    // leave empty
  OnFail
    Custom Code// I'm not sure this will do anything
    Event Loop
DB Save
Custom Code
ReDirect URL
Redirect User

Bob
danielitob 21 Dec, 2012
Dear Bob,
you are a great!Thanks very much, finally i've resolved this problem.
Thanks Thanks Thanks 🙂

Best regards,
Daniele
This topic is locked and no more replies can be posted.