close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DFP Update File Delete Existing Image File

Thread began 1/18/2010 12:37 am by online.order393818 | Last modified 1/20/2010 9:15 am by Eric Mittman | 3463 views | 7 replies |

online.order393818

DFP Update File Delete Existing Image File

Hello Jason,

I'm having the same problem with my update file deleting the existing image file when I attempt to update some of all of the page content except the image file. Even if I include the image file in the update it still doesn't update along with the rest of the content. The insert file appear to be working OK. After I insert a new item everything appears including the image file as well.

I've read over the information in the thread posted here, and I've tried all of the solutions by sticking the enter key to force the server behavior but that hasn't worked for me... Can you give me a hand with this issue?

I've attached a zip file of my items_update file along with the thread.

Thanks,
Jw

Attached Files
items_Update.zip
Sign in to reply to this post

CraigRBeta Tester

No default file name

i noticed that on line 74 of your page, there is no value associated with the default file name.

This value you want is set in the WA Upload Files server behavior and it sometimes doesnt bind properly.

Sign in to reply to this post

online.order393818

No default file name

CraigR,

Thanks for your response. As I mention in the thread I posted that I had read information about the server behavior' not binding properly. And tried the exercise to correct without any success.

My question is: What should the value be for the default file name?

I've notice that there are at least (4) other line that doesn't have any value set for the "DefaultFileName" setting as well. Should they all be the same?

If you can send me an example of the line code I'd appreciate it very much. Perhaps I can move forward then. I've been held up with this issue for more than (3) days. Hopefully there will be a update to correct this problem soon.

Thank you,
Jw

Sign in to reply to this post

CraigRBeta Tester

I think that in the attempt to get this to work, you have duplicated the server behavior a number of times, hence the multiple instances of code.

As an example, on one of my pages, i set the default file to a field in my update form called success_imageURL

On my page the code is as follows...

'DefaultFileName' => "".((isset($_POST["success_imageURL"]))?$_POST["success_imageURL"]:"") ."",

Hope this helps

Sign in to reply to this post

online.order393818

DFP Update File Delete Existing Image File

CraigR,

No It didn't work for me. Here is the code that I modified below. Perhaps you can look at it to see what is wrong with it and let me know please?

<!---

<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "/images/detail/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_POST["ItemImage"]))?$_POST["ItemImage"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 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' => "/images/thumbnail/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_POST["ItemThumb"]))?$_POST["ItemThumb"]:"") ."",
'ResizeType' => "1",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End?>

--->

Jw

Sign in to reply to this post

CraigRBeta Tester

the code looks ok at a glance.

when you say it 'didn't work', is the file not being uploaded ?

Jason from WA gave me some debugging tips.

prevent the redirect by changing the page to an empty string, then go the the bindings panel and expand the WA Digital File pro Global Status group, add the debug info binding to the page

post back the results.

** JUST NOTICED ** , try taking the leading / from the uploadfolder path, i think this may be a problem

Sign in to reply to this post

online.order393818

DFP Update File Delete Existing Image File

CraigR & Jason,

My update file appear to be working again. Actually, I'm right back to where I started from before I first encounter the problem with the update file "deleting" the image file. Now the problem is that the update will not 'over-write, or replace' the image file when I modify the item features!

When I was going through the wizard steps to configure the setting I selected 'overwrite' existing files instead of 'changing the name' in increments.

But to verify your instructions on what did make the update file start updating again. It was the instruction you gave to me with the 'code example'! Also I did remove the '/' as well. What is confusing me is that the detail, update, insert & result pages all have the same path set in them, and all of them work with the exception of the update page I suppose... After updating changes to an item, the 'detail.php?ItemID=55' page show all the changes except the image file, and I also notice too that in the item feature the previous file name for both the image & thumbnail is still the same-unchanged.

And there is one other thing I noticed about my code that I saw different with some other members code. My code filename looks like this:

'FileName' => "[FileName]",

Is that the way it should be?

Thank you,
Jw


****PROBLEM FIXED*****

CraigR & Jason,

I've corrected the problem I was having with the details described above. So I'm sharing this bit of information with guys. It might help to cut through the chase the next time you all are confrounted with a similiar problem solving effort.

I came upon the fix by chance. First here's the code in my situation:

<!----

1 <?php
2 WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
3 if($_SERVER["REQUEST_METHOD"] == "POST"){
4 WA_DFP_UploadFiles("WA_UploadResult1", "ItemImage2", "0", "", "false", $WA_UploadResult1_Params);
5 }
6 ?>
7 <?php
8 WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
9 if($_SERVER["REQUEST_METHOD"] == "POST"){
10 WA_DFP_UploadFiles("WA_UploadResult2", "ItemImage2", "0", "", "true", $WA_UploadResult2_Params);
11 }
12 ?>

---->
On line 4 & 10 the Id Name "ItemImage" where the same. On line 4 it was "ItemImage2", and on line 10 it was "ItemImage2". I changed line 4 to "ItemImage" and now my update page work actually as it was designed to. Whether I modify one field, image file, or all the fields. It update without deleting any unmodifited fields as well.

Thanks for the help
Jw

I'll be back I'm sure :-)

Sign in to reply to this post

Eric Mittman

When you edit the upload sever behaviors do you see the correct entries there but the code is not correct? I'm curious if there is an issue where what is in the server behavior is not matching what is in the code.

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