close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Uploading files - update - DFPv2

Thread began 5/25/2009 8:25 am by john.molitor259030 | Last modified 6/09/2009 7:54 am by Ray Borduin | 2310 views | 3 replies |

john.molitor259030

Uploading files - update - DFPv2

Hello, I use digital file Pro 113 with Dreaweaver CS3 under winXP pro sp3 (now DigitalFilePro v2)

ItemID = 29
ItemCatID = 5
ItemAnnee = 2008
ItemAuteur = XY
ItemName = Nom
ItemDesc = Descript.
ItemThumb = small_image.jpg
ItemImage = big_image.jpg

With digital file Pro 113, it was necessary to a field for the thumbnail and a field for the large image (detail page).
Following the procedure "Uploading files: update - interactive tutorial", works very well.

I discovered the DigitalFilePro v2, I've been interested in (productshot - small wide) image resizing.
What has seduced me also was the ability to resize in two sizes, put them on the server in different folders and enter the name of the image in the database.

Unfortunately, I followed the procedure for the 113 version and in the cases where change year or the author, but sought to modify the image. The name of the image is removed from the database.

Clearly the philosophy is not the same between the 113 version and version 2

Here's what reproduced me inspiration from the DigitalFilePro 113 for DigitalFilePro v2 tutorial.
Can you help me?

In FORM UPDATE
<input type="hidden" name="ItemThumb" id="ItemThumb" value="<?php echo(str_replace('"', '&quot;', $row_WADAitems['ItemThumb'])); ?>" size="32" />
<input type="hidden" name="ItemImage" id="ItemImage" value="<?php echo(str_replace('"', '&quot;', $row_WADAitems['ItemImage'])); ?>" size="32" />


In RECORDSET UPDATE
ItemThumb = <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_2"]["serverFileName"]; ?>
ItemImage = <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_1"]["serverFileName"]; ?>


In WA upload file
default file (big) = <?php echo ((isset($_POST["ItemImage"]))?$_POST["ItemImage"]:""); ?>
default file (small) = <?php echo ((isset($_POST["ItemThumb"]))?$_POST["ItemThumb"]:""); ?>


Will we have a small formative video for DigitalFilePro v2?
Please Mark Fletcher ;)

Uploading files: Update (Part 1) (Interactive Tutorial)
Uploading files: Update (Part 2) (Interactive Tutorial)

Thanks
John

Sign in to reply to this post

fragop363190

Check the Flash Tutorials of DFP2 everything is there.

As soon as i have time ill try posting a Full Guide about creating a full admin panel with DataAssist and DFP2 etc.

Nobody mentions in the forum about deleting files while deleting the record in db...
You need to delete file or youll have your server with too many orphans.
Also when you generate thumbnails you need to add another DELETE behavior for them and need to manualy code the 2nd behavior which should be set after DELETE1 succesfully completes. Manually code for the _thumb or any suffixes you use on the UPload behavior.

I promise ill write a small guide for all people that need it so its step by step.

Hope i helped you.

BTW u need delete file behavior on both update and detail page (if you have added the option to add a delete button there) and delete page if you have it created separately for confirmation.

And if you using thumbs, u need a 2nd 3rd 4th (as many file resizes u got in your upload behavior including your first file, in general as many file things u see in DFP2 file box that you have added you need so many Delete behaviors in the appropriate page to work, but with the 2nd+ behaviors set to run after DELETE1 has been succesfully completed.


This is what u need to manually code in DELETE2 +

<?php
$WA_DeleteFileResult1 = false;
if(isset($_POST["Delete_x"])){
$WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("../assets/images/photos/", $row_WADAimages_img['filename_img']);
}?>
<?php
$WA_DeleteFileResult2 = false;
if($WA_DeleteFileResult1){
$WA_DeleteFileResult2 = WA_FileAssist_DeleteFile("../assets/images/photos/", str_replace(".jpg","_thumb.jpg",$row_WADAimages_img['filename_img']));
}
?>

depending on what extensions you use (i force all to be made jpg as im working with logos and i dont care about transpaency and its easier for delete behavior) you do the str_replace thing. I got 1 thumbnail created. [Filename]_thumb.jpg so i take the original [Filename].jpg and change it to it by using the str_replace function. It is very easy. If you got 5 thumbs, _thumb1,_thumb2 you need to copy paste the <?php ?> code as many times and change the DeleteFileResult2 to DeleteFileResult(numbering) and the _thumb.jpg to _thumb(numbering) etc.

Or you can add the server behavior from the behaviors panel and just add the str_replace thing on the box or manualy after at code.

Hope this helps a lot of people.

By the way, new helper file of DFP2 works properly. Goo job WebAssist.

Sign in to reply to this post

john.molitor259030

Thank you, but I do not want to delete the image from the server, I just want to edit a field and store the image.

The article exists in the database: I want to change the name or description, but I do not want to change the image.

At each move, during an update, the image name is deleted from the database so I do not want to change it.

For this scenario I am looking for a solution.

Best regards
John

Sign in to reply to this post

Ray BorduinWebAssist

This is a bug. Submit a support incident and they will provide a fix. The default value isn't working properly on update pages causing the field to be cleared.

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

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