Record complete image URL
Hello,
How can I get DFP to record the full URL of the image in the database instead of just recording the file name?
Thanks,
Garry
Hello,
How can I get DFP to record the full URL of the image in the database instead of just recording the file name?
Thanks,
Garry
There are bindings for all parts of the url and file name, and you can just type in the full url manually when you do the insert or update.
So if your binding is currently: <?php echo($yourUploadFileName); ?>
You could just update it to: http://www.yoursite.com/yourdirectory/<?php echo($yourUploadFileName); ?>
Where would I add the URL... Not sure I understand the directions.
You would add it before the value that you have specified in the user interface so that it would appear in front and show the complete url.
You would update and add the url in the location where it is missing. You want it in the database in a particular column... so add it in the interface where you specify the value that is inserted into that column.
Would that be in the WA Upload Files server behavior or the Update Record server behavior?
The update record server behavior.
OK... that is where I had it before and the problem that I run into is having the URL inserted on update when I am not updating the photos in the record. This method causes the default hidden value to be ignored and the URL gets inserted into the database instead. This in turn wipes out the path to my photos.
OK... well lets fix that problem.
What exactly happens? What default hidden value? Do you have the update installed? It had an issue with the default value not working in general.
Please describe exactly what you do when the error occurs with this technique... what the exact result is and what the expected result is. I think we can fix the problem if I understand it better.
I created an admin section using data assist. I followed the procedure for digital file pro to edit the update form so in the event that I am editing something other than the photos, the update form would apply the database values via the hidden form element. This works great if I just want to store the file name in the database field and not the full path.
When I adjust the update form to insert the path as well, it causes problems when I submit the update form without attaching new photos. Instead of reapplying the already existing database values, it inserts the URL that I have added in the binding minus the file name (because one does not exist in the file upload field).
I hope that makes sense...
It shouldn't work like that. I would like to look at your code. Please post a support incident and include a copy of your update page. I think that can be corrected with a conditional statement so that the url is not added when the field was not updated.
so instead of:
http://www.yoursite.com/yourdirectory/<?php echo($yourUploadFileName); ?>
you use something like:
<?php echo(($yourUploadStatus==1)?"http://www.yoursite.com/yourdirectory/":""); ?><?php echo($yourUploadFileName); ?>
This would only add the http:// at the front if the upload status is equal to 1 (if the file was uploaded). The way you reference the updlaod status depends on the upload field on the page but you can drag it from the bindings for reference.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.