Hi
When images are uploaded, the path returned looks like
img src="/path/to/image.jpg"
How can I prepend the full URL to this, i.e.
img src="http://www.mysite.com/path/to/image.jpg"
I could pass this in as a session variable or something from outside the editor, I'd just like to know which file to modify - I suspect it's the one in the Image or File popup that shows the path... but suggestions would be appreciated from those in the know
cheers
Thu, 06/21/2007 - 01:13
#1
RE: How to prepend URL to uploaded img path
RE: How to prepend URL to uploaded img path
Hi
Thanks, but the paths in those files are not complete URLs, they are relative and absolute paths. So you end up with img src="/var/www/blah.jpg"
I need to turn this into a full URL - img src="http://wwww.blah.com/blah.jpg" and you can't do that in the config files, it has to be a hack.
cheers
RE: How to prepend URL to uploaded img path
then how is it that this works for me without any kind of hack?
$Config['UserFilesPath'] = 'http://www.mydomain.com/userfiles/' ;
$Config['UserFilesAbsolutePath'] = 'd:\\inetpub\\mydomain\\docs\\' ;
Did you even try?
RE: How to prepend URL to uploaded img path
// Path to user files relative to the document root.
$Config['UserFilesPath']
which is not the same as "full URL to files," but it's great that it does work, and let's hope that this continues to work in future versions - thanks for the help!
RE: How to prepend URL to uploaded img path
I can send you the files if you are interested.
-Scott
RE: How to prepend URL to uploaded img path
Hi,
i would be interessted to in how to cheat the paths within the Uploadmanager!
My problem is, that the internal path fits not the needs of my webapp so i have to configure them everytime by hand
Do you think your changes will also work for the Java-Servlet? I'm jusing the JSP-Connector.
Every help would be appreciated
Thank you!
Regards, Marcus
RE: How to prepend URL to uploaded img path
RE: How to prepend URL to uploaded img path
RE: How to prepend URL to uploaded img path
RE: How to prepend URL to uploaded img path
RE: How to prepend URL to uploaded img path
Best.
Scott
RE: How to prepend URL to uploaded img path
hi,
i had the same problem. I was refered to this link: http://sourceforge.net/forum/forum.php? ... _id=257180
Instead of using:
fileUrl = top.opener.FCKConfig.FullBasePath.substr(0, top.opener.FCKConfig.FullBasePath.length - top.opener.FCKConfig.BasePath.length) + fileUrl;
I hardcoded my url:
fileUrl = 'http://mysite' + fileUrl;
And this work for me now.
gl
Re: How to prepend URL to uploaded img path
erm... i'm stuck on the same problem.
i just posted q question on the same topic.
i'm lost in the discussions above.
is ther a short and easy way to get absolute paths...?
what's wrong with using something like: "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/"
(i'm not a php expert... i just got this code for something else i was working on git given this snippet for the problem i had for getting absolute paths.)
problem: i can't figure out where i shouild put the above code (assuming its a solution).
thanks.
Re: How to prepend URL to uploaded img path
Maybe my 'HOWTO - Get absolute urls with the filemanager' can be of any help.
Re: How to prepend URL to uploaded img path
i tried that.
when i click on 'browse server', it doesnt siplay the contents of the server.
there's an error icon on the bottom left of the window.
when i put the old code back: the problem goes away.
what am i doing wrong?