Karen
|
| Posted: 06/09/2003, 8:57 PM |
|
I am attempting to change the file folder as described in the help file as such:
Examples
The following example shows how to change the upload file folder depending on the login name of the logged in user.
global $files;
$files->file->FileFolder = "/www/files/" . CCGetUserLogin() . "/";
where $files is the name of the form and file is the name of the FileUpload component.
------------------
Has anyone tried this and succeeded? I'm using PHP/MySQL. Thanx for any feedback!
|
|
|
 |
Masterson
|
| Posted: 06/10/2003, 4:00 AM |
|
I tried this aproach in my application and it's work for me fine.
Do you have any problems with it?
|
|
|
 |
Karen
|
| Posted: 06/10/2003, 8:01 AM |
|
Yes, Masterson. I have some trouble with it. Are you using PHP?
I've tried relative path (= "./users/" . CCGetUserLogin() . "/";) and absolute path (= "/www/mydomain/users/" . CCGetUserLogin() . "/";) but I am getting the error that there is not enough file permissions. Perhaps my question is what do you put in the File Folder property first? Do you just put any valid directory first and then replace it with the actual one in the Before Process File event?
If you don't mind, can you describe the steps you took? Thanks for any advice!
|
|
|
 |
Masterson
|
| Posted: 06/11/2003, 2:09 AM |
|
>Are you using PHP?
Yes
>Perhaps my question is what do you put in the File Folder property first?
It must be valid directory path with enough permissions to write,
otherwise you always get such error.
>Do you just put any valid directory first and then replace it with the actual one in the Before Process File event?
Yes
>If you don't mind, can you describe the steps you took? Thanks for any advice!
1. Initially I set my File Folder property into '/tmp/'
2. Add on page AfterInitialize event with following code:
global $form_name;
$form_name->upload_component->FileFolder = "/www/users/" . CCGetUserLogin() . "/";
That's all!
|
|
|
 |
Karen
|
| Posted: 06/11/2003, 8:17 AM |
|
Very strange, I don't get any error messages and the file appears to have been uploaded but I can't seem to find it in the target folder! I can also delete it without any problems but I really have no idea where it is.
When you assign the file folder, do you start with the root directory? Or relative to it?
Thanx for the help!
|
|
|
 |
Masterson
|
| Posted: 06/11/2003, 8:30 AM |
|
I setup file folder from the root.
BTW, it's not so many places where your files can be uploaded.
For example, your initial folder: "/tmp/"
and changed folder must be: "/www/files/" . CCGetUserLogin() . "/";
1. "/tmp/" - if you didn't change File Folder correctly or after upload process
2. "/www/files/" - if user wasn't logged in
3. "/www/files/user_name/" - everything ok
I had all three phase during development process and you probably in one of them.
|
|
|
 |