Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hyperlink is not working on giving dynamic link value

    I am inserting files in database manually using sql query,the file name are in the form.'C:/Documents and Settings/Administrator/Desktop/check.js'.there is a list of files.now in front end in javascript I wrote:
    "<table><tr><td><b>Attachments: </b></td><td><a href='"+link+"'> click here</a></td></tr>";here in the link the value 'C:/Documents and Settings/Administrator/Desktop/check.js' is coming.I have checked it using alert.
    But when I am clicking on the link nothing happens,no error comes.and when I right click the link the same file which is in giving specified location is getting saved....I tried many options but all in vain.
    Can somebody help me.I am totally confused what to do now????

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try
    Code:
    file:///C:/Documents and Settings/Administrator/Desktop/check.js
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your quick reply...
    It shows the location file:///C:/Documents and Settings/Administrator/Desktop/check.js
    when I put mouse over the link....but does nothing,only when I click on save as target it is getting saved ,I am getting the file values from java,is there any need to use encodeURL to encode the link value.
    in java:
    pointer = rs_attachment.getString("Pointer");
    String pointer1 = URLEncoder.encode(pointer);
    now I am accessing this pointer1 in js using :
    in link the pointer1 is coming:
    "<tr><td></td><td><a href='"+link+"'> here</a></td></tr>";
    the thing is here that I can't give a specific value because there are many files I have to access.Is there any solution????

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So clicking on the link does nothing? It should try to download automatically in most browsers. Also are you using Java or Javascript? They are two entirely different languages.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes clicking on link does nothing....neither it shows any error.I am using javascript as front end.and in back end to get the values of attachment files I am using java.I am still stucked with the problem.

  • #6
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am working in protlet context so is the problem is occuring that I am accessing the localfiles from browser because when I am making a simple html program to open it,it is easily opened.Is the problem due to switching the context??and if it is so then what can be the solution???


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •