Questions tagged [absolute-path]

global address for a file, independent from the working directory of the calling process

An absolute (or full) path is the general form of the name of a file or directory that specifies a unique location in a file system. An absolute path contains the root directory and all other subfolders in which the requested file or folder is contained.

833 questions
38
votes
7 answers

Get relative path of the page url using javascript

In javascript, how can I get the relative path of the current url? for example http://www.example.com/test/this?page=2 I want just the /test/this?page=2
raklos
  • 28,027
  • 60
  • 183
  • 301
37
votes
6 answers

What is my script src URL?

Is there a simple and reliable way to determine the URL of the currently-executing JavaScript file (inside a web page)? My only thought on this is to scan the DOM for all the script src attributes to find how the current file was referenced and then…
Neil C. Obremski
  • 18,696
  • 24
  • 83
  • 112
35
votes
1 answer

Get absolute file path of FileField of a model instance in Django

I have a page where people can upload files to my server. I want to do something with the file in Celery. So, I need to know the absolute filepath of the uploaded FileFiled of my Model. Let's say I queried the model and got the instance. Now I need…
Kotlinboy
  • 3,725
  • 4
  • 16
  • 27
31
votes
6 answers

PHP: Require path does not work for cron job?

I have a cron job that needs to include this file: require '../includes/common.php'; however, when it is run via the cron job (and not my local testing), the relative path does not work. the cron job runs the following file (on the live…
gsquare567
  • 2,847
  • 3
  • 23
  • 21
31
votes
4 answers

Django: Get ImageField url in view

I am trying to get ImageField absolute path in Django view so I can open the image, write on it something and then serve it to user. I have problem getting absolute path for the image which is saved in media folder. item = get_object_or_404(Item,…
Byteme
  • 589
  • 2
  • 6
  • 10
30
votes
7 answers

Wrong extraction of .attr("href") in IE7 vs all other browsers?

Can it really be true that the attr("href") command for a link is handled very different in IE7 in comparison to all other browsers? Let's say I have a page at http://example.com/page.html and I have this HTML:
EmKay
  • 1,089
  • 1
  • 13
  • 28
29
votes
3 answers

How to find the working folder of a servlet based application in order to load resources

I write a Java servlet that I want to install on many instances of Tomcat on different servers. The servlet uses some static files that are packed with the war file under WEB-INF. This is the directory structure in a typical installation: -…
29
votes
7 answers

How to get the absolute path for a given relative path programmatically in Linux?

How to get the absolute path for a given relative path programmatically in Linux? Incase of Windows we have the _fullpath() API. In other words, I mean what is analogous API to _fullpath of Windows in Linux?
Jay
  • 24,173
  • 25
  • 93
  • 141
28
votes
3 answers

HTML force URL hyperlink to be treated as non-relative (absolute)

I have a list of URLs that our users have entered for websites of various clients... I am loading this list from the server into a grid for the users to see... I made the URLs clickable by wrapping them with a href HTML tag... the problem is,…
Ayyoudy
  • 3,641
  • 11
  • 47
  • 65
27
votes
6 answers

Moving Pages folder in Next.js application to src folder

In a create-next-app Next.js application, I want to move the pages folder in the root directory to a src folder. I added a jsconfig.json with the code (below), however now I get the error message "404 | This page could not be found." Anyone have any…
nmy1095
  • 333
  • 1
  • 3
  • 6
27
votes
4 answers

How get file path from std::ifstream in c++

I open a file using std::ifstream. I may open file using relative path (file.txt) or absolute path (C:\test\file.txt). As I am passing a string as the file name, I dont know whether it is relative or absolute path. Can anybody tell me how to get…
Nilesh Shinge
  • 315
  • 1
  • 4
  • 9
27
votes
1 answer

Server Document Root Path in PHP

I have a php code line like below $files = glob('myFolder/*'); I want to use absolute path to myFolder in above by using server document root, like below $_SERVER["DOCUMENT_ROOT"]."/myFolder/" It should be like below $files =…
Hiroshi Rana
  • 978
  • 2
  • 9
  • 18
26
votes
5 answers

Linking using relative path on Github README.md

I am trying to create links in my README.md that link to example code using a relative path, as opposed to the absolute path I am using now. For example, in the markdown file, if I use…
Houdini
  • 3,442
  • 9
  • 31
  • 47
25
votes
2 answers

How to concatenate an absolute path and relative path with QDir?

I have a relative path and absolute path that look something like this: Absolute: /tmp/somedir Relative: anotherdir/file.txt I would like to concatenate the two (/tmp/somedir/anotherdir/file.txt) with QDir but I am not quite sure what the proper…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
21
votes
3 answers

PHP include absolute path

I have a variable on my site called $basePath which is set as: $basePath = '/Systems/dgw/'; I am using it on all my css, js and images tags as so (shortened for better visibility):
digicom
  • 538
  • 3
  • 7
  • 20
1 2
3
55 56