View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

DFP2 questions

Thread began 5/14/2009 2:11 pm by kbettenc296716 | Last modified 5/17/2009 7:38 am by kbettenc296716 | 3191 views | 17 replies

fragop363190

Ok this is the SOLUTION for DataAssist created page with 1 and only 1 file browser and the default file (usually u use it for images no display etc) should be allready uploaded in folder since it doesnt upload it and it SHOULDN't. For me, the Default File in DFP2 wizzard that let's you browse is a mistake since its only use is for images and u can just put a file on server and just type the name of file there. In upload.php that wizard works properly, it uses only filename not path. So having a file field is a waste and mixing up some people probably. Let it a TextField and just type the name of the image to be used if nothing uploaded.

I will NOT work with more than 1 and i will explain why.

1. BUG#1 : at insert.php whatever you do it will not write down your DefaultFileName parameter. You need to manualy edit the line at the

"$WA_UploadResult1_Params["WA_UploadResult1_1"] = array("

DefaultFileName parameter and write the Full Name of the file.
The line should look like -- 'DefaultFileName' => "no_image.jpg", --
I use a no_image.jpg for my records without logo.

This bug does not exist for some reason in the update.php page. If you insert a DFP2 upload behavior over there it will put that line for you correctly. Don't ask me why im not the developer of the extension and the code is in the .MXP i can't check it.

2. BUG#2 : HelperPHP.php is faulty (for DFP2 at least, didn't use at all DFP1 even if I had it). HelperPHP.php has both DFP1 & DFP2 functions. DFP2 basic function is WA_DFP_UploadFiles() while DFP1 is WA_DFP_UploadFile (watch for the s at DFP2).

There is missing code for the DefaultFileName in DFP2's function (i didnt check DFP1 function at all only as a basic stepup so dont know what is happening there).

Solution :

A.Go at aproximately line number 300+ u will find the function's ELSE statement that occurs if there is no file to be uploaded (u didn't select anything in the file field in the form). There should be an else statement sth like the below code.

else{

$WA_DFP_UploadStatus[$statusName]["statusCode"] = 0;
$WA_DFP_UploadStatus[$statusName]["errorMessage"] = "No file uploaded";
$_SESSION[$sessionName] = '';

}

B. Change it to the below code - basically you are adding 2 lines.

else{
$fileParameters = func_get_arg(5);
$WA_DFP_UploadStatus[$statusName]["statusCode"] = 0;
$WA_DFP_UploadStatus[$statusName]["errorMessage"] = "No file uploaded";
$_SESSION[$sessionName] = '';
$WA_DFP_UploadStatus[$statusName]["serverFileName"] = $fileParameters['WA_UploadResult1_1']['DefaultFileName'];
}


Comments.

I notice this thing. When i did put an upload behavior in insert.php it wrote in HelperPHP.php. Then after i finished with the insert.php i did same thing to update.php and again it wrote in HelperPHP.php. I am assuming that it just overwrites file so to be sure that HelperPHP.php exists. This means that you fix both your insert and update.php pages with the upload behavior and THEN u edit the HelperPHP.php file or you will loose the code you added. Also keep the code somewhere in a text file cause whatever you do you will probably end up overwriting that helper file again so u just go there and edit it pasting the proper code. You could also rename it as HelperPHP_fixed.php probably and edit the include file above your pages so even if webassist overwrites HelperPHP.php your application wont be affected. All this assuming that HelperPHP is never changing and it is same always. A WebAssist tech could tell us about it so we just rename it its better and safer.

This could be posted as minor bug if this is the case and WebAssist products using that file should check if it exists and if it exists they should skip the copy process so it doesnt modify our file.

Agai I repeat this is a TEMPORARY FIX for 1 FILE FIELD in DataAssist Wizard's generated pages, didn't test it to other pages nor i will cause i'm out of time.

The reason that it is only for 1 file field it is that the DFP2 main function send all parameters via an arguement with an array called "$WA_UploadResult#_Params".

This is an associative array and cause u might have multiple fields the HelperPHP.php functions need to be able to process all fields. So i have handcoded at the code the

$WA_DFP_UploadStatus[$statusName]["serverFileName"] = $fileParameters['WA_UploadResult1_1']['DefaultFileName'];

check 'WA_UploadResult1_1' which should be taken ny a variable that resolves inside a loop so to address all File Fileds in form. As i don't want to use more time and go to further testing currently, cause i suppose now Technicians can fix it up soon properly and not as my fix i won't even trying looping it. If someone has time to play with it and you find the proper code working for multiple fields post it here :)

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