close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Create Folder

Thread began 9/20/2009 6:51 pm by dataworks388155 | Last modified 9/25/2009 9:15 am by Jason Byrnes | 6146 views | 12 replies |

dataworks388155

Create Folder

Is there any way to have Digital File Pro create an upload folder on the server based on server variables or Cookies to upload files in?

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, click the lightning bolt next to Upload Folder and select the desired session variable from the Dynamic Data bindings.

Sign in to reply to this post

dataworks388155

Create Upload Folder

Thanks.


I am trying this and it is not working. What I want to do is to upload to folder

Members/PrimarySchools/<?php echo $row_OrgInfo['OrgID']; ?>/

where <?php echo $row_OrgInfo['OrgID']; ?> is the dynamic text from the database.

Is this the right way to build a path to an upload folder and have File Upload create the folder if it does not exist?

Dexter

Sign in to reply to this post

anonymous

Hey Dexter,

Where is that code located? I noticed you have a PHP open and close tag surrounding an echo command... but my guess is that you are already within a PHP block of code for the DFP server behaviors. If that is the case, you don't want to nest a PHP block within a PHP block.

Best regards,

Brian

Sign in to reply to this post

Jason ByrnesWebAssist

make sure the Upload server behavior code comes after the recordset. If the recordset is not created before the file is uploaded, the $row_OrgInfo['OrgID'] wont have a value yet.

Sign in to reply to this post

dataworks388155

Don't Understand

Thanks, but exactly what should be in the DFP Upload Folder text box?

Members/<?php echo $row_OrgInfo['OrgID']; ?>/ ?
Members/?php echo $row_OrgInfo['OrgID']; ?/ ?

or what other text? When I use the lightning bolt, I get

<?php echo $row_OrgInfo['OrgID']; ?>

But this does not work either. If the value of ORGID is 10, I want it to create a folder named 10 in the Members Folder, and upload the file logo there.

Sign in to reply to this post

anonymous

If it is inside a php block, you will only need to set the value as

$row_OrgInfo['OrgID']

not with the PHP echo command...

But you will want to concatenate it with the other stuff in the variable so it is clear to PHP how to process...

for example, if you folder path is "/images/", when you set the variable, your code should look like this

'UploadFolder' => "Members/PrimarySchools/".$row_OrgInfo['OrgID']."",

Remember to set the permissions correctly in the parent folder, as well. You have to enable write permissions of the Primary Schools folder in order to create folders within.

Cheers,

Brian

Sign in to reply to this post

dataworks388155

Still Not Working

This is the code as it stands now.

Notice the code for uploading Logo is exactly as you described.
However, the folder is still not being created. and nothing is uploaded.

Permissions are set for both the Members and the PrimarySchools Folder to allow Everything for Everybody. (777)

What is wrong?

<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "Members/PrimarySchools/".$row_OrgInfo['OrgID']."",
'FileName' => "Logo",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "Members/PrimarySchools/",
'FileName' => "Logo_thumb",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End?>
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "Members/PrimarySchools/".$row_OrgInfo['OrgID'] ."/",
'FileName' => "MissionVision",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End?>
<?php
// WA_UploadResult3 Params Start
$WA_UploadResult3_Params = array();
// WA_UploadResult3_1 Start
$WA_UploadResult3_Params["WA_UploadResult3_1"] = array(
'UploadFolder' => "Members/PrimarySchools/".$row_OrgInfo['OrgID'] ."/",
'FileName' => "SongPrayer",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult3_1 End
// WA_UploadResult3 Params End?>
<?php
// WA_UploadResult4 Params Start
$WA_UploadResult4_Params = array();
// WA_UploadResult4_1 Start
$WA_UploadResult4_Params["WA_UploadResult4_1"] = array(
'UploadFolder' => "Members/PrimarySchools/",
'FileName' => "RulesRegs",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult4_1 End
// WA_UploadResult4 Params End?>

Sign in to reply to this post

Jason ByrnesWebAssist

Lets take a step back for a moment.


Can you get the upload to work without trying to dynamically set the upload folder name?

We need to first determine if it is a problem with uploading, or the dynamically named folder.

If you can get the upload to work without the dynamically named folder, then try again using the recordset. If your still having problems, add the php page to a zip file and attach it to your reply so I can see the entire code on the page including the recordset.

Sign in to reply to this post

dataworks388155

Yes

Yes.
It is working without dynamically inserting a folder name.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...