I want to provide a link to download a file. There are two values that
I retrieve from a table that need to be concatenated to create the
full path to the file. I am able to retrieve the values one at a time
and they display correctly, but, when I try to concatenate them
together, the Filepath value is left out of the URL string and instead
displayed IN FRONT of the URL??

The values display just fine one at a time:
echo $file->getFilepath();
prints /this/correct/path/

echo $file->getFilename();
prints thisfile.pdf

That all looks good! But when I try to make one long URL out of
them...
$full_path_to_file = 'http://mysite.com'.$file->getFilepath().$file-
>getFilename();
echo $full_path_to_file
prints /this/correct/path/ http://mysite.comthisfile.pdf
BUT it should be http://mysite.com/this/correct/path/thisfile.pdf

I also tried removing the leading and ending slashes in the Filepath
to produce: this/correct/path instead of /this/correct/path/  and then
$full_path_to_file = 'http://mysite.com/.$file->getFilepath().'/'.
$file->getFilename();
but the results are exactly the same.

If I could get the full path to the file to print out correctly, I
would use it like this:
<a href="<?php echo $full_path_to_file ?>" >Download File</a> as I
don't think I can use the link_to helper with this.

What am I doing wrong? Is it not possible to concatenate URL paths? I
feel stupid that I can't do something so simple.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to