Rick Page
|
Posted: 12/12/2003, 6:25 AM |
|
I know that there are lots of upload questions and examples, but I can't seem to find a solution for my situation. So I am going to add to the number of already existing requests on this subject.
Here is my situation.
I have a web site for independent christian musicians. On this site they can upload their photo, sample songs and etc. I originally did the site with Code Charge and had the uploads stored in the database as blobs.
I am now working on redoing the site with Code Charge Studio and want to have the files saved in a folder.
I have the upload form working correctly inside the add artist form.
This is better than having to add the artist then go back into edit the artist and display the upload box there.
So what's the problem?
I can fill out the default path where to store the uploaded file. What I want to do is have a folder structure of:
-Artists
-- 'artist_group_name'
artist_group_name being one of the fields.
I am sure that I need to add custom code probably into the AfterUpdate and AfterInsert areas, but am not quite sure how to tackle the problem. I am hoping that someone else has already done something similar and could enlighten me.
Thanks for your help.
Rick Page
|
|
|
Noname
|
Posted: 12/15/2003, 6:22 AM |
|
Rick,
You can change the FileFolder and make it different for each user in the form’s Before Build Update/Insert events, e.g.:
$form_name->FileUpload1->FileFolder = “/Artist/”. $form_name->artist_group_name->Value;
But make sure that the folder exists and has enough read/write permissions (chmod 777 seems to be required)
|
|
|
Rick Page
|
Posted: 12/15/2003, 1:13 PM |
|
Thanks noname,
This will come in handy, but only handles half my problem.
How do I create a folder on the fly that is based on the artist_group_name field?
Rick
|
|
|
Rick Page
|
Posted: 12/15/2003, 1:36 PM |
|
Noname,
I think I see what you were saying now. I will need to work with it a little more.
Rick
|
|
|
Oper
|
Posted: 12/15/2003, 2:30 PM |
|
<%
dim fs,f
set fs=server.createobject("Scripting.FileSystemObject")
set f=fs.CreateFolder("\WEB\newfolder");
set f=Nothing
set fs=Nothing
%>
Note: User need to have Write Access! (be careful)
|
|
|
Rick Page
|
Posted: 12/19/2003, 2:40 PM |
|
---------------------------------------------
<%
dim fs,f
set fs=server.createobject("Scripting.FileSystemObject")
set f=fs.CreateFolder("\WEB\newfolder");
set f=Nothing
set fs=Nothing
%>
-------------------------------------------------
Do you have a PHP equivalent?
Rick
|
|
|