Extracting a filename from a file attachment and using that as a hyperlink. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Extracting a filename from a file attachment and using that as a hyperlink.

Last post 08-17-2009 03:06 PM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-29-2009 02:21 AM

    • zhang79
    • Not Ranked
      Male
    • Joined on 07-09-2009
    • Shanghai, China + Indianapolis, IN, US
    • Posts 3

    Extracting a filename from a file attachment and using that as a hyperlink.

    Hi folks,

    I'm using qRules already to upload a file to another document library but what is generated using qRulesLink and qRulesFilename are actually just links to uploaded file on SharePoint. Right now, I have a hyperlink set to display a string that the user gives the file in a text box and then I have the link set to qRulesLink. While this works, I don't feel like this is the most elegant solution. Would it be possible to extract the filename from the file attachment control directly instead of asking for user input, saving that name in a field and then setting the link as soon as the file is uploaded?

    Thanks all.

  • 08-14-2009 08:05 AM In reply to

    Re: Extracting a filename from a file attachment and using that as a hyperlink.

    Hi Zhang, I'm not sure that I understand your question. qRules does not require user input when saving the file to SharePoint. It indeed does autodetect the filename and uses that to create the link. Can you provide more details concerning the user input? I have not seen this scenario before. Thank you.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-15-2009 09:29 AM In reply to

    • zhang79
    • Not Ranked
      Male
    • Joined on 07-09-2009
    • Shanghai, China + Indianapolis, IN, US
    • Posts 3

    Re: Extracting a filename from a file attachment and using that as a hyperlink.

    Ernesto, when I use qRules' qRulesFilename and qRulesLink, it ends up giving me the same value for both (the full URL of the file is returned). I would like it to return only the filename, without the SharePoint document library location in the front. To compensate for the long URL (due to how our server is set up), I've had the user give a file title for the attachment.

     e.g. If the location of the file is http://www.stuff.com/sharePoint/documents/08162009_aFile.txt, then qRulesFilename and qRulesLink end up being the same value. I would like the "http://www.stuff.com/sharePoint/documents/" to be removed so that the returned value is just 08162009_aFile.txt. Is there any method to do this?

  • 08-17-2009 03:06 PM In reply to

    Re: Extracting a filename from a file attachment and using that as a hyperlink.

    You are right. Both are the same when doing a SP upload. Conceivably it could be altered to show just the datetime stamp prepended filename (which was necessary to avoid overwrite conflicts), though we would need to go back and research the reason we chose to implement it this way.

     

    As a workaround you can use the “substring-after()” function to get just the filename you want and display that value. You can even add a node to store this value automatically with a default value formula if you want.

     

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.