close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update product image

Thread began 8/23/2016 2:02 pm by Jose | Last modified 8/23/2016 5:00 pm by Ray Borduin | 715 views | 8 replies |

Jose

Update product image

Hi again. Using file upload not grabbing productImage . I set Default file with my recortset. Do I need to do something else? I meant, if I update the name for example it not keep the image. Only if I insert again

Sign in to reply to this post

Ray BorduinWebAssist

That should work. It could be an issue with the order of the server behaviors on the page. You would want to make sure your recordset is above the upload server behavior. If you attached a copy of the page I could take a look.

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

Jose

This is the field
<input name="ProductImage" type="file" class="form-control" id="ProductImage" value="<?php echo($Recordset1->getColumnVal("Image")); ?>">
and the update server behavior
$UpdateQuery->bindColumn("Image", "s", "".((isset($_FILES["ProductImage"]))?$_FILES["ProductImage"]["name"]:"") ."", "WA_DEFAULT");
Default file
'DefaultFileName' => "".($Recordset1->getColumnVal("Image")) ."",

the form has the same setting like insert. example

<form method="post" enctype="multipart/form-data" name="form1" id="form1" role="form">

Sign in to reply to this post

Ray BorduinWebAssist

You can't set the value of a file field.

You can set the default value of the file upload field in the file upload server behavior... that is where you set it to the existing recordset value.

Your update query should be set to the Upload File value "Server File Name". It will contain the name of the uploaded file if one was uploaded and will use the default value (set to the recordset field) when no file is uploaded.

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

Jose

I also did like this but not worked
<input name="ProductImage" type="file" class="form-control" id="ProductImage">
let me try the whay you say.

Sign in to reply to this post

Jose

I want you see because I don't find the error

Sign in to reply to this post

Ray BorduinWebAssist

Your Update server behavior bindings needs to be set to the upload file value "Server File Name". The rest seems correct.

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

Jose

ok let me try that thank you very much.

Sign in to reply to this post

Jose

Okay now works perfectly. Thank you Ray

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