For example, I use file_put()
to upload file.rar
to public_html/rar/
. Would it be possible for me to get the web address of that .rar file?
views:
12answers:
1
+1
A:
You'd have to know that ftp path /public_html/ is the document root for the website. Once you know that, you can just strip the FTP path down.
You can obviously do this for particular sites, but there's no real way to automatically determine the document root, so this can't be done automatically without asking the user where the document root is.
(I guess you could try to guess based on common paths like 'public_html' or 'www' or 'content', but you'd only be guessing and could be wrong)
AllenJB
2010-06-16 08:30:25