close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I want to insert a url to an image file name being inserted to the database with a simple file browse

Thread began 4/29/2020 6:45 pm by jo271221 | Last modified 5/06/2020 5:02 pm by Ray Borduin | 659 views | 9 replies |

jo271221

I want to insert a url to an image file name being inserted to the database with a simple file browse

I want to insert the full path to the image so that the image can be viewed on various pages and websites within our network without the need of having the path the the image on the page.

We are doing this on another site using the html editor. file kfm/configuration
$kfm_userfiles_output = "https://mywebsite.com" .rel2abs($kfm_userfiles_address,dirname(__FILE__));

On this site we are not using the html editor or file manager and I don't have a kfm directory

On line 23 of wa/file-manipulation/helperphp.php I found this
function makeFolder($thePath) {
$thePath = str_replace("\\","/",$thePath);
$theParentPath = substr($thePath,0,strrpos($thePath,"/"));

Or possibly the kcfinder/conf/config.php

FTP info in PM

Sign in to reply to this post

Ray BorduinWebAssist

Just add it in the front when you display the image. I don't think you need it in the database.

If you want it in the database, just add it in front in the Insert to Database server behavior bindings.

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

jo271221

I need it to be inserted in the DB -
original
$UpdateQuery->bindColumn("horse_pic5", "s", "".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]) ."", "WA_BLANK");

Revision below worked other than I need the correct format to add the horse id -
<?php echo($WADAhorses_update->getColumnVal("horseid")); ?>

$UpdateQuery->bindColumn("horse_profile_pic", "s", "https://mysupersite.com/horse-sale-2020/horseid/".$WA_DFP_Status["WA_UploadResult2"]["WA_UploadResult2_1"]["serverFileName"] ."", "WA_BLANK");

My attempt at horseid did not work.

$UpdateQuery->bindColumn("horse_profile_pic", "s", "https://mysupersite.com/horse-sale-2020/$WADAhorses_update->getColumnVal("horseid")/".$WA_DFP_Status["WA_UploadResult2"]["WA_UploadResult2_1"]["serverFileName"] ."", "WA_BLANK");

Sign in to reply to this post

Ray BorduinWebAssist

It should be:

$UpdateQuery->bindColumn("horse_pic5", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]) ."", "WA_BLANK");

Just make sure the WADAhorses recordset code is above this code.

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

jo271221

Thank you!!! That worked perfectly!

Sign in to reply to this post

jo271221

OOPS - It did not work perfectly. The url prefix s getting inserted whenever the page is updated NOT just when the user adds pictures.

If you add a new image it works. But if you update the page without adding a new image it does not work.
Please see PM.

Sign in to reply to this post

Ray BorduinWebAssist

Try this... first remove all of the default file names in the file uploads, so the lines:
'DefaultFileName' => "".($WADAhorses_update->getColumnVal("horse_profile_pic") ) ."",

become:
'DefaultFileName' => "",

Then update the bindings from:

php:
$UpdateQuery->bindColumn("horse_profile_pic", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"])  ."", "WA_BLANK");

  $UpdateQuery->bindColumn("horse_pic2", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"])  ."", "WA_BLANK");
  $UpdateQuery->bindColumn("horse_pic3", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"])  ."", "WA_BLANK");
  $UpdateQuery->bindColumn("horse_pic4", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"])  ."", "WA_BLANK");
  $UpdateQuery->bindColumn("horse_pic5", "s", "https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]) ."", "WA_BLANK");


to:

php:
$UpdateQuery->bindColumn("horse_profile_pic", "s", "".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]):"")  ."", "WA_IGNORE");

  $UpdateQuery->bindColumn("horse_pic2", "s", "".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic3", "s", "".($WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic4", "s", "".($WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic5", "s", "".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]):"")  ."", "WA_IGNORE");
Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

I am getting a blank page.

Sign in to reply to this post

Ray BorduinWebAssist

I've updated the code chunk above. It should have been:

php:
$UpdateQuery->bindColumn("horse_profile_pic", "s", "".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]):"")  ."", "WA_IGNORE");

  $UpdateQuery->bindColumn("horse_pic2", "s", "".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic3", "s", "".($WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic4", "s", "".($WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"]):"")  ."", "WA_IGNORE");
  $UpdateQuery->bindColumn("horse_pic5", "s", "".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]?"https://mysupersite.com/horse-sale-2020/".$WADAhorses_update->getColumnVal("horseid") ."/".($WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"]):"")  ."", "WA_IGNORE");
Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

Perfect! Thank you!

Sign in to reply to this post
loading

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