Get the current absolute path name?
How to get the current absolute path and file name in javascript?
If using CS3 or CS4
alert($.fileName);
or this should work on all versions.
function WhoAmI() {
var where;
try {var F = FO;
}catch( err ) {where = File(err.fileName);}
return where;
NB: Neither will work if you are using binary scripts!
Similar Messages
-
Getting the local full path name of a file from an item File Browser
Hi all,
I would like to get the local full path name, of a file selected from an item 'File browser'.
I see in wwv_flow_files the column 'name', but actually it's a kind of id like 'F1542335/myFile.gif' for example.
What i want is the local path of this file ("C:\Documents and Settings\All Users\....\myFile.gif").
I hope this is possible??
Anyway, thanks all for reading.
LudoHello, thank you for the answer.
Please understand that I searched before posting, and not ony 15 min.
What i mean is that the value of a File Browser in an Apex applocation is something like 'F1542335/myFile.gif', but what I need is the local path location.
And 'F1542335/' is not the local path location, i can't use it. Or maybe there is a way to convert it in a proper path name, such as "C:\Documents and Settings\....", but I don't think so.
So my question is : how to get the local path name of a file in Apex?
I'll answer if I find some good things.
Thanks
Ludo
Edited by: user12945874 on 06-avr.-2010 3:59 -
How to get the current FILE PATH?
I want to get the File Path on my Java Programming, which class / method can get a File Path on the windows?
thanks!I want to get the current working directory(e.g.
c:\Tomcat5.0\webapps\)
If this is a web application you're talking about and you want the directory where that application is installed, that's almost certainly not the CWD. It might be one of the context or whatever variables that's available to servlets. Look in the servlet API and see what's there. -
How can I get the server absolute path of virtual directory?
Problem context:
absolute path of my application at JRUN server is
c:\testing
nd url is
http://kaspak/test
( kaspak is a machine local to server i-e client nd server r at same machine )
I m uploading a file nd saving it at server.
PROBLEM:
server save my uploaded file at
C:\Program Files\Allaire\JRun\servers\default
[ a path where server is installed ]
while I want to save it at directory
c:\testing\uploadfiles
How can I achieve this???
waiting for quick reply..
KasPakhere is a function for which u said,
protected void readAndSaveFile(MultipartInputStreamHandler in,
String boundary,
String filename,
String contentType) throws IOException
A utility method that reads a single part of the multipart request that represents a file, and saves the file to the given directory. A subclass can override this method for a better optimized or differently behaved implementation.
again saving a file, or uploading a file is no problem,
but saving a file at our desired location,
nd this can only be done if we know reall/absolute path of our application at server,
i-e we need an API which can tells the absolute path of our application.
e.g
our application url is http://kaspak/testcode
we need its absolute mapping to directory on server
e.g it it is at c:\testcode
if we get the absolute path then we can pass it in above function or in File class constructor.
isn't it??
I think in this way i can save file at other location.
But how i can get absolute path?????
thanks for ur reply,
nd waiting for ur reply again.
wbw
kaspak -
How to get the current user name in Provider hosted app using appOnlyAccessToken
Hi,
Please help me, how to get the HostWeb UserName in Provider Hosted App
i have Provider hosted App, and Anonymous Authentication is enabled on AppWeb, using appOnlyAccessToken
Below code does not return current user who Log in in hostweb, it is returning
SharePoint App (app@sharepoint)
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
clientContext.Load(web.CurrentUser);
clientContext.ExecuteQuery();
clientContext.Web.CurrentUser.LoginName;
Below code gives a blank name when Anonymous Authentication is enabled, if Anonymous Authentication is disabled
app prompts for credentials
HttpContext.Current.User.Identity.Name
Thanks
RamHi,
Since you are using a provider Hosted app if you want to get the current logged in name than do not use AppOnlyAccessToken else use AccessToken which is App + user Context AccessToken.
then
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
clientContext.Load(web.CurrentUser);
clientContext.ExecuteQuery();
clientContext.Web.CurrentUser.LoginName;will return proper user Name.
HttpContext.Current.User.Identity.Name will never return the user as this object is related to IIS server of your App Server not sharepoint.you should set this as Anonymous in case of provider hosted app.you can download the below sample which uses the AccessToken which has user name in it.https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer -
How to get the current logical system?
Dear Abapers:
I can't find the logical system value from the table SYST, pls tell me how to get the current logical system name, Thanks!Hi,
Check with the table T000, the Logical system field name is LOGSYS.
Regards
Thiru -
How to get the current executing file/itself absolute directory?
hellooo,
gentlemen/lady, how to get the current executing file/itself absolute directory?
thanks
Hello,
you can get the real path information of the JSP through the servlet context:
http://java.sun.com/products/servlet/2.2/javadoc/index.html
javax.servlet
Interface ServletContext
Method getRealPath
Christian Plenagl
Developer Relations Engineer
BEA Support
[email protected] (alex mok) wrote:
>hellooo,
>
>gentlemen/lady, how to get the current executing file/itself absolute
>directory?
>
>thanks
-
Getting the current path from which the form is runnig in 9i OAS
Hi,
We are using the built in Get_Application_property to get the
current path in which the form is running. However this does not
work in 9ioas and it only returns the form name and not the full
path. Does anyone have any solutions to this problem?
Thanks in Advance
JeetPlace it in the classpath, then you can use ClassLoader#getResource().
-
How to get the current filename and & or path
How can I get the current path or filename?
I didn't really find any answers in the net. this.path or app.path were suggested but I couldn't get it to work.
Thanks in advance for your answer!
Livecycle Designer ES 8.2.1.3144.1.471865Hi,
event.target.path.toString(); will give the full path including the filename.
event.target.documentFileName.toString(); will give the filename only.
Good luck,
Niall -
How to get the current path of my application in java ?
how to get the current path of my application in java ?
thanksTo get the path where your application has been installed you have to do the following:
have a class called "what_ever" in the folder.
then you do a litte:
String path=
what_ever.class.getRessource("what_ever.class").toString()
That get you a string like:
file:/C:/Program Files/Cool_program/what_ever.class
Then you process the result a little to remove anything you don't want:
path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
//Might be a little error here but you should find out //quickly if it's the case
And here you go, you have a nice
C:/Program Files/Cool_program
which is the path to your application.
Hooray -
How to get the current schema name
Hi,
Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
Thanks
Jogeshok folks, I found the answer at Tom's as usual.
http://asktom.oracle.com/tkyte/who_called_me/index.html
I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
cheers,
paul
create or replace
FUNCTION SELF_EXAM (
p_call_stack VARCHAR2,
p_type VARCHAR2 DEFAULT 'SCHEMA'
) RETURN VARCHAR2
AS
str_stack VARCHAR2(4000);
int_n PLS_INTEGER;
str_line VARCHAR2(255);
found_stack BOOLEAN DEFAULT FALSE;
int_cnt PLS_INTEGER := 0;
str_caller VARCHAR2(30);
str_name VARCHAR2(30);
str_owner VARCHAR2(30);
str_type VARCHAR2(30);
BEGIN
str_stack := p_call_stack;
-- Loop through each line of the call stack
LOOP
int_n := INSTR( str_stack, chr(10) );
EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
-- get the line
str_line := SUBSTR( str_stack, 1, int_n - 1 );
-- remove the line from the stack str
str_stack := substr( str_stack, int_n + 1 );
IF NOT found_stack
THEN
IF str_line like '%handle%number%name%'
THEN
found_stack := TRUE;
END IF;
ELSE
int_cnt := int_cnt + 1;
-- cnt = 1 is ME
-- cnt = 2 is MY Caller
-- cnt = 3 is Their Caller
IF int_cnt = 1
THEN
str_line := SUBSTR( str_line, 22 );
dbms_output.put_line('->' || str_line);
IF str_line LIKE 'pr%'
THEN
int_n := LENGTH('procedure ');
ELSIF str_line LIKE 'fun%'
THEN
int_n := LENGTH('function ');
ELSIF str_line LIKE 'package body%'
THEN
int_n := LENGTH('package body ');
ELSIF str_line LIKE 'pack%'
THEN
int_n := LENGTH('package ');
ELSIF str_line LIKE 'anonymous%'
THEN
int_n := LENGTH('anonymous block ');
ELSE
int_n := null;
END IF;
IF int_n IS NOT NULL
THEN
str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
ELSE
str_type := 'TRIGGER';
END IF;
str_line := SUBSTR( str_line, NVL(int_n,1) );
int_n := INSTR( str_line, '.' );
str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
str_name := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
END IF;
END IF;
END LOOP;
IF UPPER(p_type) = 'NAME'
THEN
RETURN str_name;
ELSIF UPPER(p_type) = 'SCHEMA.NAME'
OR UPPER(p_type) = 'OWNER.NAME'
THEN
RETURN str_owner || '.' || str_name;
ELSIF UPPER(p_type) = 'TYPE'
THEN
RETURN str_type;
ELSE
RETURN str_owner;
END IF;
END SELF_EXAM; -
How to get the current function name in java
How to get the current function name in java.
In c it is done as
printf("%s",__func__);
Thanx in advance.j0o wrote:
System.out.println("Class Name: " + new Exception().getStackTrace()[0].getClassName() +
"/n Method Name : " + new Exception().getStackTrace()[0].getMethodName() +
"/n Line number : " + new Exception().getStackTrace()[0].getLineNumber());
I pointed the OP at this approach yesterday in one of his multi-posts. I still have not been given my Dukes! -
How to get the current class name in static method?
Hi,
I'd like to get the current class name in a static method. This class is intended to be extended. So I would expect that the subclass need not to override this method and at the runtime, the method can get the subclass name.
getClass() doesn't work, because it is not a static method.
I would suggest Java to make getClass() static. It makes sense.
But in the mean time, does anybody give an idea to work around it?
Thank you,
BillWhy not create an instance in a static method and use getClass() of the instance?
public class Test {
public static Class getClassName() {
return new Test().getClass(); -
Re: Getting the current server name
If you are running inside the server as a startup class or a server side
component, you can use weblogic.management.Admin.getServerName().
-Sabha
Anand Shukla wrote:
Hi,
How can i get the running weblogic server name.
AnandHow do I get the server and domain names for the current server-side component on a newer version that no longer has this class? I could get it from and MBean, but I need to know the servername to locate the MBean.
-
hi,
i am working on webcenter space application.i need to pass current space name to bean.how can i get the current space name??
Regards
Vinay KumarNo, that will not compile. You probably need to do:
SpacesContext sc = SpacesContext.getCurrentInstance();
String spaceName = sc.getCurrentSpaceName();
Beware that the doc says "Return the SpacesContext instance for the request that is being processed by the current thread, if any."
So the SpacesContext might be null.
Jaap
Maybe you are looking for
-
Content Conversion Parameter in File Receiver Adapter
Hi all, I have created one File Receiver Adapter with Message Protocol 'File Content Conversion' and with the following configuration: Recordset Structure: Message Message.fieldFixedLengths: 1000 My Message Type is: LogErro_MT Message (Type: String
-
270 dollar zen extra broken after short warranty left high and
My Zen Xtra is fi've months old I haven't dropped it and when I picked it up to use the other day it wouldn't work. It turns on and visually looks as though its playing a song but no sound comes out. The menu works until you try to do something that
-
How do I get top of page curl (IDCS4 to SWF doc) to show when inserted into DW?
Is there a way to get the top & bottom of page curls to show on my web page the way they do in the html preview? (With a transparant efffect?) I've attached the SWf file, if that helps. Thanx in advance for any advice.
-
I received this email from our web developer who is building a web interface connection to SAP via XI. His email says: I wonder if either of you know whether the XI interface supports the WS-Transaction or WS-AtomicTransaction specifications? I'm try
-
The hp logo won't come when i start it after installing windows 7 professional
I have a pavilion g6 had copied the SW setup for the home basic which came with it and installed it in windows professional but the hp logo wont come when i start the laptop i what that logo to come when i start the laptop. Please Help