ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

v6 Custom Upload Folder "Destination Directory Not Available"

drgolden 07 May, 2018
Repost due to bad tag

I want to save files to folders based on the User Id. In this case the UserId is 649
In a custom code block after Submit I have:
<?php
$this->set("mypath",
"G\wamp\www\GoldRibbon\components\com_chronoforms6\chronoforms\uploads\Cust{user:id}");
?>
Using custom code block {var.pr:mypath} this prints out correctly as:
G:\wamp\www\GoldRibbon\components\com_chronoforms6\chronoforms\uploads\Cust649

The Upload Directory Path is set to : {var:mypath}
On an upload I get the error message "Destination directory not available." The folder definitely exists on my computer.
The debugger results are:

Array
(
[option] => com_chronoforms6
[chronoform] => test-copy
[event] => submit
[user_id] =>
[radio8] => n
[file19] => Jennifer A
side1.pdf
[aid] => 25
[text1] => don is here
[button2] =>
[Itemid] =>
)
Array
(
[save_data10] => Array
(
[data] => Array
(
[option] => com_chronoforms6
[chronoform] => test-copy
[event] => submit
[user_id] => 649
[radio8] => n
[file19] => Jennifer A
side1.pdf
[aid] => 25
[text1] => don is here
[button2] =>
[Itemid] =>
[modified] => 2018-05-06
23:06:56
)

[_success] => Data saved
successfully
[log] => Array
(
[0] => UPDATE
`chronoforms_data_test` AS `data8` SET `user_id` = '649', `radio8` = 'n',
`file19` = 'Jennifer A side1.pdf', `text1` = 'don is here', `modified` = '2018-05-06
23:06:56' WHERE `aid` = '25';
)

[var] => Array
(
[user_id] => 649
[radio8] => n
[file19] => Jennifer A
side1.pdf
[text1] => don is here
[modified] => 2018-05-06
23:06:56
)

)

[upload15] => Array
(
[path] => G:\wamp\www\GoldRibbon\components\com_chronoforms6\chronoforms\uploads\Cust649\
[var] =>
)

)
}
healyhatman 07 May, 2018
Does the full directory, including the custom part at the end, all exist?
drgolden 07 May, 2018
The folder is writeable and exists.

If I just input the entire path without using the {user:id} variable it works fine.

In custom code this php statement gets me to the proper uploads directory

<?php$this->set("mypath1", $path.DS."components".DS."com_chronoforms6".DS."chronoforms".DS."uploads".DS);?>

I want to be able to construct this statement so that mypath1 ends "/chronoforms/uploads/cust649"

I think my problem is with syntax.

What would be the proper syntax to add "cust" + the {user_id} variable to the end of this statement so the path ends with (assuming the user_id is 649)?:.../chronoforms/uploads/cust649
healyhatman 07 May, 2018
{path:}/uploads/cust{user:id}/

Just use that, it'll give you /srvr/usr/public_html/yourwebsite.com/components/com_chronoforms6/chronoforms/uploads/cust649/
drgolden 08 May, 2018
It worked! Thanks so much. This was a major headache.
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com