Welcome, Guest
Username: Password: Remember me

TOPIC: Path to file

Path to file 05 Feb 2013 10:56 #6630

  • Ferm
  • Ferm's Avatar
  • Offline
  • Junior Member
  • Posts: 39
  • Thank you received: 6
  • Karma: 2
Hi,

Simple question. I looked through the forum but I couldn't find this.

I am using the "file" type in a table to upload a document. Is there a simple way to get the full path to the file from JDOM?

If I call JDom::_('html.fly.file.default') and set indirect to false, it will return html code including the path but I can't figure out ho to only get the path so that I can access the file directly in the component.

Sorry if this has already been asked and anserwed.

E
The administrator has disabled public write access.

Re: Path to file 05 Feb 2013 12:00 #6631

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @Ferm,

You might want to check out this topic: www.j-cook.pro/forum/32-trouble-shooting...-uploaded-files#6042

It's not strictly what you want to do but may help.

BTW, what kind of file is it? Is it a PDF that you want to display in the browser or to give download link?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: Path to file 05 Feb 2013 21:51 #6644

  • Ferm
  • Ferm's Avatar
  • Offline
  • Junior Member
  • Posts: 39
  • Thank you received: 6
  • Karma: 2
Thanks for your answer. I think that is a different question though. It is not a big problem as it is easy to put together the path to the file. I was just curious if I could get it with a simple call to a JDOM method.

E
The administrator has disabled public write access.

Re: Path to file 05 Feb 2013 22:46 #6645

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi

Sure, JDom is totally customisable, just:
  1. take one of the classes (and its assets etc)
  2. clone it
  3. rename it
  4. rename the class(es)
  5. make any adjustments you require such as chmod'ing the file on upload, changing path, adding js (Ajax uploader) or whatever.
Start with a class close to the type you require - so, as you're already doing, start with file class.

A good place to look at an example of customising JDom is in the tutorial: j-cook.pro/docs/tutorials

do you need to render the file in browser or link to download?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
Time to create page: 0.093 seconds

Get Started