close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Moving Images after Upload

Thread began 12/20/2010 1:55 am by Dave Buchholz | Last modified 1/08/2011 4:04 am by Dave Buchholz | 2004 views | 5 replies |

Dave BuchholzBeta Tester

Moving Images after Upload

I have an issue on a client's site that I am working on at the moment where the host insists on having a seperate public_html and secure_html folder



Which for the purposes of this site means I have to maintain exact copies of all files in each. My question is that the admin system currently resides in the secure_html folder so that the client logs in under ssl so is there a way I can add an extra DFP behaviour that will move a copy of the uploaded image to the same location in the public_html folder ?

Sign in to reply to this post

Ray BorduinWebAssist

Have you tried using two Upload server behaviors with the different directory settings? I haven't done this but it seems like it would work.

Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

Ray,

No I haven't because I cannot replicate the directory structure on my local server (I do not run SSL on my local MAMP server), if step up directories as I would normally i.e. ../../../../public_html/uploads/frontpage/ is that what you envisaged ?

Sign in to reply to this post

Ray BorduinWebAssist

Yes that is what I was thinking could work.

Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

ok I'll give it a try, thanks Ray

Sign in to reply to this post

Dave BuchholzBeta Tester

Just to follow this up as I had some time to do some testing this morning. I was able to get DFP (or File Manipulation as it is called now) to upload an image both to the secure and public image directories.

The final code looked like this:

php:
<?php

// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
    
'UploadFolder' => "../../../uploads/test/images/",
    
'FileName' => "[FileName]",
    
'DefaultFileName' => "",
    
'ResizeType' => "0",
    
'ResizeWidth' => "0",
    
'ResizeHeight' => "0",
    
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
    
'UploadFolder' => "../../../../public_html/uploads/test/images/",
    
'FileName' => "[FileName]",
    
'DefaultFileName' => "",
    
'ResizeType' => "0",
    
'ResizeWidth' => "0",
    
'ResizeHeight' => "0",
    
'ResizeFillColor' => "" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct
("WA_UploadResult1");
if(
$_SERVER["REQUEST_METHOD"] == "POST"){
    
WA_DFP_UploadFiles("WA_UploadResult1""image""2""[NewFileName]_[Increment]""false"$WA_UploadResult1_Params);
}
?>



And this is what the debug code reported:

Debug: Status object: WA_UploadResult1
statusCode : 1
errorMessage :
clientFileName : IMG_0991.jpg
fileExtension : jpg
serverFileName : IMG_0991.jpg
serverSimpleFileName : IMG_0991
serverDirectory : /home/xxx/secure_html/uploads/test/images/
contentType : image/jpeg
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : 124169
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName : IMG_0991.jpg
fileExtension : jpg
serverFileName : IMG_0991.jpg
serverSimpleFileName : IMG_0991
serverDirectory : /home/xxx/secure_html/uploads/test/images/
contentType : image/jpeg
fileSize : 124169
imageWidth : -1
imageHeight : -1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
statusCode : 1
WA_UploadResult1_2:
clientFileName : IMG_0991.jpg
fileExtension : jpg
serverFileName : IMG_0991.jpg
serverSimpleFileName : IMG_0991
serverDirectory : /home/xxx/public_html/uploads/test/images/
contentType : image/jpeg
fileSize : 124169
imageWidth : -1
imageHeight : -1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
statusCode : 1



Note that I am uploading in the secure folder initially as that is where the admin system is located.

Sign in to reply to this post

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...