On Tue, 29 Sep 2009, Farrukh Abbas wrote:
for instance i don't like using a href= /a ... something like link_to()
which would be coherent with the rest of the application/framework
But your link is not an action, and link_to() uses routing...
and also that i could use
You can use the function _compute_public_path($source, $dir, $ext,
$absolute = false)
$path = _compute_public_path('myfilename', 'myfolder','','absolute');
echo link_to('download file', $path);
On Sep 27, 2:54 pm, dagger strategy.vs.lo...@gmail.com wrote:
Hi,
A simple question... How can i
thanks people but this solves the purpose
a href=?php echo
public_path('/uploads/'.$support_activity-getFilePath()) ?
target=_blankdownload attachement/a
public_path returns a url like
http://localhost:8080/myproject/web/uploads/b3a2fe88caa89fa97a7443cdcf55e608.pdf
exactly what was needed...
On Mon, 28 Sep 2009, Farrukh Abbas wrote:
any suggestions to improve ?
Define 'improve' ?
--
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
symfony users group.
To post to this group, send email to
for instance i don't like using a href= /a ... something like link_to()
which would be coherent with the rest of the application/framework
and also that i could use sfConfig::get('sf_upload_dir_name') instead of
/uploads/ string (btw - why is this config variable removed from defaults
in sf 1.2?
using symfony 1.2
On Sun, Sep 27, 2009 at 2:54 PM, dagger strategy.vs.lo...@gmail.com wrote:
Hi,
A simple question... How can i create a download link to a file
uploaded to uploads directory under web of symfony?
something like - ?php echo link_to('download file', 'uploads/
file.pdf')?
On Sun, 27 Sep 2009, dagger wrote:
A simple question... How can i create a download link to a file
uploaded to uploads directory under web of symfony?
something like - ?php echo link_to('download file', 'uploads/
file.pdf')?
Not sxure what the problem is since you anwered your own
That produces an error saying the rout is not defined... N plus i want
the link to be like http://localhost:8080/sfproject/web/uploads/myfile.pdf
so when I deploy it on the server The URL will automatically become
www.mydomain.com/uploads/myfile.pdf
... Right now I have to sort of hard
Yes I believe it is the solution i was looking for... I will try it
out as soon as I get back home... Thanks a lot. :)
--
Kind regards
Farrukh Abbas
On 27 Sep 2009, at 19:27, Gábor Fási maerl...@gmail.com wrote:
Check out the public_path() helper, I believe that's what you need.
On Sun,
On Sun, 27 Sep 2009, Farrukh Abbas wrote:
Yes I believe it is the solution i was looking for... I will try it
out as soon as I get back home... Thanks a lot. :)
The other thing is, you dont really need urls ending in .pdf to get passed
to the symfony controller. So you could edit your
link_to is meant from internal uri's, and by that I mean either a
route name (@whatever) or a module/action string. I've had trouble
with this myself. You've probably already found that it strips off
the 'uploads' part of the string.
To get this to work you'll have to add the absolute=true
11 matches
Mail list logo