[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Farrukh Abbas
using symfony 1.2 On Sun, Sep 27, 2009 at 2:54 PM, dagger 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 - file.pdf')?> > > thanks for the reply > > > -- kind regards Farrukh K. Muham

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Eno
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 - file.pdf')?> Not sxure what the problem is since you anwered your own question. -- --~--~-~--~~

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Farrukh Abbas
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 co

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Gábor Fási
Check out the public_path() helper, I believe that's what you need. On Sun, Sep 27, 2009 at 19:22, Farrukh Abbas wrote: > > 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 o

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Farrukh Abbas
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 wrote: > > Check out the public_path() helper, I believe that's what you need. > > On Sun, Sep 27, 2009 at

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Eno
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

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-27 Thread Jonathan
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 opt

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-28 Thread Johnny Lattouf
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 wrote: > Hi, > > A simple question... How can i create a download link to

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-28 Thread Farrukh Abbas
thanks people but this solves the purpose download attachement public_path returns a url like http://localhost:8080/myproject/web/uploads/b3a2fe88caa89fa97a7443cdcf55e608.pdf exactly what was needed... any suggestions to improve ? On Mon, Sep 28, 2009 at 1:19 PM, Johnny Lattouf wrote: > > You

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-28 Thread Eno
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 symfon

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-28 Thread Farrukh Abbas
for instance i don't like using ... 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? sfConfig:

[symfony-users] Re: how to create a download link to a file in uploads directory?

2009-09-29 Thread Eno
On Tue, 29 Sep 2009, Farrukh Abbas wrote: > for instance i don't like using ... 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 sfConfig::get('sf_upload_dir_