How can i get the absolute filepath  while uploading a file

Hi techies,
could you help in solving the following prob..
I am trying to upload a file path to the database...for ths i've used input type="file" tag and i can only retreive th ename of the file and could not able to retreive the entire file path starting from root directory.
I am in linux environment and using firefox as browser.
I would reapply appreciate any help in this regard.
Thank you very much.
dandu.

you don't need the path. There is no valid reason you can come up with that you need anything more then the file name. Try giving any reason you can think of and I'll explain why you don't it.

Similar Messages

  • C Programming: How can we get the filesystem name for a given file-path?

    C Programming: How can we get the filesystem name for a given file-path?
    Say I have a filepath=/mnt1/file1
    Using some OS API like stat, can I get the Filesystem /mnt ?
    Thanks in advance,
    -V

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can I get the Voice memo's source computer file to keep the original file name?

         I ran out of space in my iPhone some weeks ago and I've been cleaning up. I am pretty much done deleting the photos and apps. The only thing I need to finish is erasing my voice memos. I already synced my music/voice memos with my computer, the only problem is that when I get the files from the iTunes media it changes the name and makes it extremely hard to organize. I want to upload this files to another website so I can access them freely.
    I would REALLY appreciated if anyone could tell me how to fix this or if you have another method please tell me.

    This is pretty straightforward.
    If the file isn't too big you can just read the entire file contents:
    set fileContents to read file "HD:path:to:the:file.txt"
    Once you've read it in, you can iterate through it with a repeat loop like:
    repeat with eachParagraph in (paragraphs of fileContents)
      -- code here to process each line
    end repeat
    Within the loop, eachParagraph represents each successive line in the file, so all you need to do is pull out the data you want. Now your subject says that your file is tab-delimited, but your example uses commas, so you may need to adjust this script depending on what's actually the case:
    set my text item delimiters to tab -- or "," as appropriate
    set firstName to text item 1 of eachParagraph
    set lastName to text item 2 of eachParagraph
    set emailAddr to last text item of eachParagraph
    -- rest of code here to send an email
    The last thing to do is to reset the 'text item delimiters' to their previous value so you don't end up getting confused.
    So, putting that all together you end up with something like:
    set fileContents to read file "HD:path:to:the:file.txt"
    set oldTIDs to my text item delimiters -- additional code to remember the current TIDs
    set my text item delimiters to tab -- or ","
    repeat with eachParagraph in (paragraphs of fileContents)
      set firstName to text item 1 of eachParagraph
      set lastName to text item 2 of eachParagraph
      set emailAddr to last text item of eachParagraph
      -- rest of code here to send an email
    end repeat
    set my text item delimiters to oldTIDs -- restore the TIDs for cleanliness
    Note that this should work for reasonably-sized files (up to a few thousand records). If it's much more than that you may need something a little more sophisticated to read the file progressively rather than all at once.

  • How can I Locate the correct filepath in a jsp page?

    In http://localhost:8080/myweb/a.jsp, I will call a java bean file which is locate in http://localhost:8080/myweb/WEB-INF/classes/haha/DBConnection.class. This java file requires to read an external file which locates in http://localhost:8080/myweb/WEB-INF/classes/haha/db.txt
    My question is how can I get the correct filepath in this environment?
    inputStream = new BufferedReader(new FileReader(????????));
    Only this will work
    inputStream = new BufferedReader(new FileReader("D:\Program Files\Apache Software Foundation\Tomcat 5.5\db.txt"));
    But no one will place the file here, and it is impossible to do this when upload to 3rd party hosting.
    Any suggestion? thx.

    Thx all, in a jsp page, calling this method is fine.
    ServletContext s = getServletContext();
    String a = s.getRealPath("/");
    In a Servlet file, below method is ready to use:
    String b = getServletConfig().getServletContext().getRealPath("/");
    My problem is, I have a jsp page, which initialize a java bean , this java file is responsible for Database Connection, which will read the external text file to get the login, password and database name. So I won't need to recompile this file every time when I place in different platform with different configuration. I only need to edit the text file is ok.
    But How can I get the absolute file path when that jsp page initialize that java bean file? Below is my error, any suggestions are thx.
    package sql;
    import java.sql.*;
    import java.util.ArrayList;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DBConnection extends HttpServlet{
    public String sql = null;
    public Connection con = null;
    public Statement statement = null;
    public ResultSet rs = null;
    private BufferedReader inputStream = null;
    private static ArrayList<String> arr = new ArrayList<String>();
      public DBConnection(){
        String fs = System.getProperty("file.separator");
        ServletContext s = getServletContext();
        String realpath = s.getRealPath("/");
        String filepath = realpath + "WEB-INF"+fs+"Properties"+fs+"db.txt";
        try{
          inputStream = new BufferedReader(new FileReader(filepath));
          String l;
          while ((l = inputStream.readLine()) != null) {
            arr.add(l);
          Class.forName("com.mysql.jdbc.Driver");
          this.con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+arr.get(0)+"?user=" +arr.get(1)+ "&password="+arr.get(2)+"&useUnicode=true&characterEncoding=utf-8");
          this.statement = this.con.createStatement();
        }catch (Exception e){
          System.err.println(e.getMessage());
        }finally{
    }java.lang.NullPointerException
         javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159)
         sql.DBConnection.<init>(DBConnection.java:20)
         html.ShowCategory.<init>(ShowCategory.java:17)
         org.apache.jsp.left_jsp._jspService(left_jsp.java:66)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • How can I get the HTML codes in illustrator?

    Hi, I am a graphic designer, and I am getting into the web world, I wanna know how can I get the HTML codes to upload a web design made using Illustrator,...¡?Does any one know?Please let me know...

    everyone here is right, dreamweaver is better and you will need to understand html for this to work. HOWEVER, you can make a functional website using just illustrator and notepad (or text edit if you're on a mac).
    Design your site in illy, slice it up with the slice tool. http://s23.postimg.org/mv311kpp7/test_illy.jpg 
    Save for web and select html and images, you'll get an html file and an images folder. Open the HTML file in your text editing program and it will look like this: http://s10.postimg.org/f32nf6r2h/html_stuff.jpg   you'll have to know HTML codes but you can find tutorials online for most stuff, you'll just have to figure it out. In my fake site, i linked a button to google so i had to add <a href> tags to the code. http://s22.postimg.org/5avpadhch/a_href.jpg  save the html file and open it in your web browser, hopefully not IE. You can't tell in the picture but the middle button actually does link to google. http://s21.postimg.org/qd77slqmf/firefox.jpg

  • How can I get the screen to lock on my iPhone 4, so I don't press buttons while talking?

    I just upgraded to the iPhone 4.  When I am talking on the phone, the screen doesn't lock, so I am constantly pressing buttons or hanging up on the person I'm talking to.  How can I get the screen to lock while I'm talking?  It's driving me NUTS.

    The otterbox is one of the culprits. Take the phone out of the case and see if it still happens. If so it is not the case. If the problem goes away, then you may need to make the hole slightly larger. My family has three iPhone 4's in otterboxes and none have this problem. Other users on this forum have reported success with the above methods.

  • How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    Thanks for answering
    Well, the CS2 was my 1st full program that now my son is using in his new Laptop...
    The CS4 Master Collection is my full program that I bought when I was in College course and now I use for my own works...
    Both came in their own serial numbers and discs ... I install both completely to each computer but at the end on the registration asked for this "Validation code" and the message says that I can't do it on-line nor by mail; so to call to this phone 1-800-833-6687 and in there have the message to come to the "support " Adobe website and do all this going around.
    Now I saw previously that page you send me... I really don't understand it ... I got CS2 installed but I just need the validation code to get rid of that 30 days message...
    Why I have to uninstall it??? Could you explain me please..

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • How can i get the meta data from database?

    Hi, all java and db experts,
    I need to write a tool to generate java file which will be used to hold the resultset of a stored procedure of Oracle. Is there any API call or tools to connect to db and then get the meta data of the return cursor instead of reading stored procedure definition on my own?
    Please help, thanks a lot.
    Hanna

    if i execute a Oracle stored procedure, the resultset of a cursor is returned. It's easy to know the meta data at the runtime.
    However, could i get the meta data about the resultset of a cursor before runtime? Such as by connecting to the database and ask it about meta data of a specified stored procedure?
    Is it feasible?
    DatabaseMetaData dbmd = conn.getMetaData();
    ResultSet rs = dbmd.getProcedureColumns("", "%", "SP_NAME", "%");
    while (rs.next()) {
    String colName = rs.getString(4);
    int colType = rs.getInt(5);
    int colDataType = rs.getInt(6);
    int colPrecision = rs.getInt(8);
    int colLen = rs.getInt(9);
    int colScale = rs.getInt(10);
    long defaultValue = rs.getLong(11);
    But what i get is a list of stored procedure parameters. In oracle, cursor is IN OUT parameter . How can i get the meta data about the resultset of cursor?

  • How can I get the underlying object from the ObjectReference

    Dear friends,
    I think this question has been asked a couple of times. But, I am still wondering if anybody has found an answer to it. Maybe this is some common need ...
    I would like to get the underlying object for which the ObjectReference is
    a mirror For example, I have a class Customer in my application, and I can get an ObjectReference through JDI during runtime. But how can I get the target VM's object which is a real instance of Customer, by which I can invoke methods defined in Customer?
    Thank you so much for any input!
    SunnyDay

    I'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
    If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
    function getParentDoc(testObj) {
        //Get object for current page
        try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
        catch(er) {return;}
        //Step backwards to first page in document
        var prevPage = curPage.PagePrev;
        while (prevPage.ObjectValid())
            curPage = prevPage;
            prevPage = prevPage.PagePrev;
        //Compare with first pages of open documents
        var testDoc = app.FirstOpenDoc;
        while (testDoc.ObjectValid())
            if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
            testDoc = testDoc.NextOpenDocInSession;    
        return;
    To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions.

  • How can i get the external Sql result return data to abap?

    Dear All
             I have a problem to how to get the select  result data return abap.
    I used abap to run external SQL server. below is my code:
    ***in above ,abap has already connected external SQL.
    Sql = u2018select * from user01u2019
          CALL METHOD OF rec 'Open'
            EXPORTING #1 = sql
            #2 = con
            #3 = '1'.
          IF NOT sy-subrc = 0.
            MESSAGE e000 WITH 'run external sql error!'.
          ENDIF.
    ***now ,below code how can I get the select result to abap code?
    I know I can use native_sql  such as u2018OPEN CUR1 FOR SELECT * FROM user01 AND FETCH NEXT CUR1 INTO :WAu2019.
        Thanks for all
    Sun

    Thanks.
    it is okay now by myself.
    con_str = 'Provider=SQLOLEDB.1;Password=pwd;Persist Security Info=True;User ID=name;Initial Catalog=VTL_DEMO;Data Source=192.168.21.50'.
      CREATE OBJECT o_conn 'ADODB.Connection'.
      CREATE OBJECT o_rec 'ADODB.Recordset'.
      SET PROPERTY OF o_conn 'Provider' = provider.
      SET PROPERTY OF o_conn 'ConnectionString' = con_str.
      CALL METHOD OF o_conn 'Open'.
      sql_str = 'select *  from userh'.
      CALL METHOD OF o_conn 'Execute' = o_recordset
        EXPORTING
        #1 = sql_str.
       #2 = o_conn.
      GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      REFRESH itab.
      WHILE rs_eof NE 1.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 0.
        GET PROPERTY OF o_field 'Value' = itab-name.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 1.
        GET PROPERTY OF o_field 'Value' =  itab-cid.
        APPEND itab.
        CALL METHOD OF o_recordset 'MoveNext'.
        GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      ENDWHILE.

  • How can i get the SMTP IP address for gmail

    Hello,
    sapian,
              I want to schedule a webi document through BI Launch Pad to users email address gmail.So while configuring the AdaptiveJobServer in CMC i need to give SMTP details such as
    Domain name:
    Host:
    Port:
    So for scheduling a webi document to a gmail user i need the above details for gmail SMTP server.Can any one suggest me how can i get the above details for gmail SMTP server.
    Thanks in advance.
    Regards,
    Kishor Kumar S

    Hi Hrishikesh,
    i have configured the 'stunnel.conf' file with the following details
    accept  =static ip address of the machine colon port number where the stunnel is installed
    connect = smtp.gmail.com:465
    and i saved the file.
    when i go to
    Start->Stunnel->service install
    it is giving error as follows
    Error binding ssmtp to (ip address and port number which i have given in stunnel.conf file 'accept')
    bind: No error (0)
    Can you suggest me the solution for the above error.
    Thanks in advance,
    Regards,
    Kishor

  • I am using 3.6. How can I get the update to look just like this version? I truly don't want to use IE or MSN but if that is all I have, then let me know. Thanks

    I am using 3.6 because I like how it spreads out my toolbars instead of just giving me the bookmarks in the corner and the lonesome firefox in the opposite corner. I know I can open the bookmark toolbar but it is not the same. I want the file, edit, view, history, bookmarks, tools, help toolbar across. How can I get the new firefox to do that

    This should duplicate the image that you posted as your preferred appearance for Firefox 5 in the above (request to be LOCKED) duplicate thread.
    '''Menu Bar'''<br />
    *right-click empty space at the end of the Tab Bar, click "Menu Bar" to place a checkmark
    *Menu Bar checked = Menu Bar on; Firefox button off
    *Menu Bar un-checked = Menu Bar off; Firefox button on
    *Other methods of doing the same:
    **click Firefox button > Options, click Menu Bar
    **Quick toggle Menu Bar on/off: ALT+V+T+M
    '''Tabs on Top'''<br />
    *right-click empty space at the end of the Tab Bar, click "Tabs on Top" to remove the checkmark
    *Tabs on Top checked = Tabs above toolbars
    *Tabs on Top un-checked = Tabs below toolbars
    *Other methods of doing the same:
    **click Firefox button > Options, click Tabs on Top
    **Quick toggle Tabs on Top on/off: ALT+V+T+T
    '''Separate Reload / Stop buttons and position of Home button'''<br />
    *Open the Customize window; do one of the following:
    **right-click the empty space at the end of the Tab bar, choose "Customize"
    **click Firefox button > Options > Toolbar Layout
    **if using the Menu Bar, click View > Toobars, click Customize
    **Quick open Customize window: ATL+V+T+C
    *the Reload and Stop buttons will be shown separate between the URL/Location bar and the Search Bar. While the Customize window is open, do one of the following, to keep the buttons separate:
    **drag the Stop button to the left of the Reload button
    **drag a "Space" between the Reload and Stop buttons
    **drag one or both buttons anywhere on the Navigation bar separated by a "Space" or another icon or reverse the order to Stop-Reload to keep them separate
    *drag the Home button to the right of the Search Bar
    *click "Done" at the bottom right of the Customize window when finished.
    '''Color Back/Forward, Home, Stop and Reload buttons'''<br />
    *Install this add-on: https://addons.mozilla.org/en-US/firefox/addon/firefox-3-theme-for-firefox/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]

  • How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your repl

    How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your reply. Thanks!

    It's good to read Antoniad's post.  It reassures me that I can use my new iPad as an international communication device which is the reason I purchased the thing.  However, I called Verizon today (my provider of cellular data) who told me that I can't just pop in a SIM card as you suggested.  He also said that he was from the "Pre-Pay" division of Verizon and he was certain that I couldn't do what I planned to do.  I was extremely disappointed as I had called Apple prior to buying the iPad and I read the algorhythm on the website for choosing an iPad before purchasing.  Those sources were quite specific and the information seemed clear.  I would be able to use my iPad to communicate through cellular connections while traveling on the road, literally, abroad.  I was told that I could pop in a data card wherever I was, just as you indicated in your message above, and voila I was good to go.  The Verizon rep definitively rained on that parade, but said that I might be able to do this if I have a "Post-Pay" account, a different area of Verizon.  I haven't had the chance to talk to this division yet, so I looked to Apple's Support for answers.  Maybe I will find out that I can use my iPad as an international communication device while traveling on the road afterall, however, it appears I may need a different type of account (Post-Pay), something I was never warned about. Can I switch to this kind of account?  I don't know.  I have to find out.  If you have any information about this issue, it would be good to share since I strongly suspect there are others who bought the iPad for the same purpose that I have.

  • How can I get the cursor's position in a opened file and display a menu?

    Hello,
    I want to make a program by which I will be able to display a panel/pops up menu at the corsor's current position, (In any text/doc file or in the desktop, we can display a menu by right click of the mouse.) Now I want my program to do the same task.
    More clearly-
    1. First I would save some words or sentences in a file(aa.txt).
    2. Then I would open another text file/ a word/ excel/ or any other editor( bb.txt / cc.doc / dd.xls / ee.html ).
    3. While editing or writing something in the opened file, if I click the right mouse button/ press a key (ctrl+space), a menu will appear containing the sentences I saved in the file(aa.txt) previously.
    My program will tell me the cursor's position in bb.txt / cc.doc / dd.xls / ee.html that i opened. And display a menu. my problem is not reading / writing in a file.
    My problem is how can I get the cursor's position in a opened file display a menu at that position by a mouse/key action*.
    Would you please help me on this regard.
    Thanks

    DrClap wrote:
    I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
    [http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
    <quote>
    ...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
    The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
    </quote>
    So I guess that a non-sequitor ... or is it?

Maybe you are looking for

  • Mac OS recovery problem. Need help

    Hello toevery one. I have defective SATA cable to HD bay now. And also new clean SDD Samsung 840 Pro 240 GB (without data or any OS on it) installed in HD bay I've ordered a new cable, but I'd like to use the SSD untill then, if it was possible so I

  • Unable to open /delete a Web Template in Development

    Hi Experts, I am unable to open a web template. It says "You do not have sufficient authorization to change the template,Do you want to  create a copy". I need to delete this template and when i click on delete ,there is no impact on the template. Pl

  • Red desktop on second monitor problem

    Hi,im having a strange issue with a cinema hd display set up as a second monitor on an imac, its showing the desktop fine but its all red coloured. If i connect a 17" hanns g monitor using the dvi its fine but if i connect an lg monitor that shows up

  • Publish web services with SAP 7.1

    hello everybody, i'm working with a sap installation netweaver 7.1 i want publish some functions as web services. I made it many time with NW 7.0 without problem. At the moment i'm using the same procedure: SE37 - function name - Utilities - create w

  • Problems after deleting page,

    Hello, First time poster. I am working on a 100 page book in iPhoto 09. I removed a page in the first few pages due to poor photo quality, and now want to add a page to take its place. However, I receive the warning that I have 100 pages and cannot a