Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • vaibhav 119 posts 139 karma points
    May 13, 2011 @ 09:49
    vaibhav
    0

    uploading files using upload control

    Hi,

    I have one upload control where i upload the files from the server.

    I want to create a link from which i will open the uploaded file in the new window.

    I want to do it using xslt ....

    i tried doing somthing like this ...

    <a href="{$currentPage/ancestor-or-self::*[@isDoc]/pubSelectfile}"> >> </a>

    where pubSelectfile = alias of upload control

    but it is not working.

    How to do this?

  • Stuart Burrows 61 posts 110 karma points
    May 13, 2011 @ 17:41
    Stuart Burrows
    0

    Hello,

    Not sure about how your xml is structured - if you can add this info that would be helpful.

    In the meantime is the upload control on the current page or elsewhere? If there is only one instance of an uploaded file you could go up to the root and interate through all decendants for the match. Here is one way:

    <xsl:variable name="upload" select="$currentPage/ancestor::*[@id=-1]//pubSelectfile" />

    <
    href="{$upload}">> </a>
  • vaibhav 119 posts 139 karma points
    May 16, 2011 @ 07:47
    vaibhav
    0
    <a href="{$upload}"> >> </a>

    I know i can link it like this but i want to open that in new window...how to do that ?....

    i will give the path of the file using upload control & i want to open that file in new window when ever some one clicks on that link.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 16, 2011 @ 08:35
    Dirk De Grave
    0

    Hi,

    <a target="_blank" href="{$upload}>...</a>

    should do the trick..

     

    Cheers,

    /Dirk

  • vaibhav 119 posts 139 karma points
    May 16, 2011 @ 09:36
    vaibhav
    0

    Hi,

    now can open new window on link click ...but can u say how to open some pdf or ms word file in that window ...bucause when i attach some files to it & click on that link ...then it asks open with or save options ....

     

  • Stuart Burrows 61 posts 110 karma points
    May 16, 2011 @ 09:43
    Stuart Burrows
    0

    I believe this is dependant on the user's setup for pdf files. Additionally .doc files don't render in browser windows to my knowledge.

  • vaibhav 119 posts 139 karma points
    May 16, 2011 @ 09:49
    vaibhav
    0

    Ok,

    Thanx all for ur help...

Please Sign in or register to post replies

Write your reply to:

Draft