imroza
Posts: 21
|
| Posted: 07/25/2008, 10:02 AM |
|
I Have found many discussion about problem in object. I found this solution
Step 1. to change FileFolder on Insert/Update. Insert this code in BeforeProcessFile ( For Example $form->id->Value is folder name that i want create; $form->perc->FileFolder is FileUpload Control)
--------------------------------------------------------
global $form;
//create folder if not exist
$directoryname=$form->id->Value;
if(!is_dir("../dir/".$directoryname."/")) {
mkdir("../dir/".$directoryname."/");
}
//Change FileFolder
$form->perc->FileFolder = "../dir/".$directoryname."/" ;
Step 2. to change FileFolder where Form find file
--------------------------------------------------------
in FileFolder Property of "perc" insert:
../dir/".trocar('idprot')."
where "trocar('$prot)" is a function that generate folder name
Hope Useful
Rob    
|
 |
 |
lachof
Posts: 14
|
| Posted: 10/29/2008, 4:29 PM |
|
I need to do something similar but the folder changes according to a URL variable, any suggestions?
thnx in advance!
lachof
|
 |
 |
Gena
Posts: 591
|
| Posted: 10/29/2008, 4:41 PM |
|
get URL parameter and do what you want...
$param = CCGetParam("paramname","");
....
_________________
Gena |
 |
 |
kirchaj
Posts: 215
|
| Posted: 10/30/2008, 5:46 AM |
|
I do something similar with a session variable in the beforeprocessfile event
$NewRecord1->FileUpload1->FileFolder = "/var/www/html/portfolio/uploads/" . CCGetUserLogin() . "/";
Hope this helps.
TK
|
 |
 |