473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to get the absolute path of a file?

momotaro
357 100+
Hi everyone,

am trying to get the absolute file path of a given document (image) so I can store its path in my database as a string but I can't seem to find how. I user $_FILE no luck. please advise.

Thank you in advance.
Jun 16 '12 #1
2 2103
Luuk
1,047 Expert 1GB
I think its wiser to store relative path, relative to the root of your website?

That way you can reinstall everything in a different location, or on a different server more easily
Jun 16 '12 #2
momotaro
357 100+
Yes am completely OK with that but I can't figure how
thank you.
Jun 18 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dchaffin | last post by:
I'm having a problem using file_exists with an absolute path and I can not figure out why. I tried the exact example that is on www.php.net ... <?php $filename = '/path/to/foo.txt'; if...
3
by: rajuvk | last post by:
I am setting up a website with a number of folders like: / (the document root) /user /admin/ /content in the /user folder there is a flie "userlogged.php", which I want to include in every...
2
by: schaf | last post by:
Hello ! Im trying to access some XML Document by an absolute path with document() in my XSL-File. It looks like this: <xsl:param name="pData" as="xs:anyURI"/> <xsl:param name="sData"...
1
by: William Starr Moake | last post by:
Another problem with absolute paths in the WYSIWYG editor I'm putting together. The function to toggle between WYSIWYG and HTML modes works except for one glitch. If you use a relative path for...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
by: mhadi | last post by:
Hi All, I am developing a solutions for clients to run some webpages. Since there is no webserver the ASP route is a No Go. So I am using Javascript to connect to my database. The Problem is that...
19
by: Jerry M. Gartner | last post by:
Greetings: What is the best way to resolve paths within a document regardless of what path it is opened under? For example: I have x.php and it contains <img src="images...">, (amongst other...
0
by: elgdav | last post by:
Hello, is it possible in C#.Net to get a path to a file in the form "\\Spain\Madrid\readme.txt" from a relative path i.e "readme.txt" or from a absolute path in the following form...
2
by: Adam Right | last post by:
Hi All, I'm developping a site using VS2008 (c#) on IIS 6.0. In my application images are not shown by the image control, they are in the web server machine and the main folder path is...
1
by: andredz | last post by:
Is there away to access some NFS symlink files that are set using absolute paths from Windows? I'm able to access symlink files is there are set using relative paths. Assume on Linux (mylinux):...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.